• 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

stay with the last 15 elements of an array [duplicate]

PHP, how to convert Int value to Week days

Warning: A non-numeric value encountered

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

PHP web3 ERC20 token function call

Phpunit partial mock + proxy Entity

Laravel display validation error

Explode not working properly with dash

PHP Find Array Index value in multi-line array

I want to display default profile image if user do not have profile image

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

Yii2: How do I debug console commands?

Detect if PHP session exists

Get all WooCommerce products within own plugin

How can I stop a symfony process which is listening on http://127.0.0.1:8000

About Contact Privacy policy Terms and conditions