• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

In PHP, which is faster: preg_split or explode?

phpexplodepreg-split


PHP Snippet 1:

$keyword = explode(' ', $_GET['search']); //or preg_split
print_r($keyword);

$keyword = array_filter($arr, 'empty');
print_r($keyword);

Related Snippets

How to modify CSS in a specific page of the WP admin dashboard (backend)

Get sum of arrays inside array

Image upload not working through ajax Laravel

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Dynamic dropdown Ajax PHP request

Open a popup box after receiving result from ajax

How to get array values using foreach in laravel

Limit of log line written to Apache Errorlog from mod php error_log

phpunit - testing is painfully slow

Target class controller does not exist - Laravel 8

Laravel Jetsream Profile page not loading on fresh install

Redirect to previous page with php

how to pass row id in href of a tag in codeigniter controller?

Magento 2 - Controller returning blank page

merge all files in directory to one text file

About Contact Privacy policy Terms and conditions