• 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

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

VB.NET WebRequest with PHP POST

Adding the custom page with add_menu_page function on Wordpress

Assign output of PHP function to a variable

Session timeout in Yii2

Twig - How to check if variable is a number / integer

HTML and PHP in one file

How to properly start Laravel 8 with Bootstrap & authentication

Add restriction to WooCommerce coupons by allowed user ID

Laravel 5 issue with wherePivot

Laravel 8 Multiple Relationships for Factory

generating a random code in php?

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

Popup Window and PHP form

Create a zip file and download it

About Contact Privacy policy Terms and conditions