• 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

Adding reCAPTCHA v2 into my PHP file

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

Converting array to string and then back in PHP

Lumen - Postgresql setup - Composer

The sum of the user's points

Call to undefined function openssl_decrypt

MySQL default time format UTC or GMT?

Why is this PHP array not the same?

PHP random string generator

How update php.ini on a Mac OS X Mojave?

PHP if in_array() how to get the key as well?

Laravel Passport - Not able to get token string in response?

cakephp save drag and drop list order to database

How to loop sql table data inside a html table

How to send parameters in soap request in php in __soapcall() function

About Contact Privacy policy Terms and conditions