• 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

Add Class in html Dynamically in PHP

Sliders in Laravel

How to map the two arrays with a duplicate value?

Show date difference as "20" instead of "20 years ago"

Laravel database insert with combining array and string

Laravel 5.5 change unauthenticated login redirect url

PHP echo values of all sub keys [duplicate]

SQLSTATE[HY000]: General error: 1 table posts has no column named *

Render the content of default_filter.php in Joomla front-end

Facebook PHP SDK - will not logout properly

Implode array with array of glue strings

carbon generated datetime not stored correctly into the database

Yii2 select2 database exception number of bound variables does not match number of tokens

backup files to google drive using PHP

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

About Contact Privacy policy Terms and conditions