• 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

Assets not referencing to public folder (Laravel)

Multiply each value in array using array_map function

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

PHP web3 ERC20 token function call

Transfer data between JavaScript and PHP through JSON

Show rotation of tweets using current day of month

PHP-Sort array based on another array?

Lumen - Postgresql setup - Composer

Last order would be re-order in wooCommerce. How is it possible?

Apply filter array/return terms

Laravel phpunit test failing authorization

Laravel SQL query midnight time not showing

Laravel csrf token mismatch for ajax POST Request

Sliders in Laravel

Laravel Model save() & update() Not Saving

About Contact Privacy policy Terms and conditions