• 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

How to fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

Star rating with half star support

phpunit - testing is painfully slow

Using spatie/media-library, how to rename a collection of uploaded files?

Show rotation of tweets using current day of month

Call to undefined function openssl_decrypt

Store multiple fields in JSON column (Nova CMS)

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

How avoid Moved Permanently The document has moved here

How do I get friend list from Friends table with counts of friends of my friends

How to upload mpdf file after generating to s3 bucket in php

Center point of multiple gps coordinates with php

How can I get new CSRF token in LARAVEL by using ajax

PHP Download MP3 files from directory on server

Creating live search with AJAX and CodeIgniter

About Contact Privacy policy Terms and conditions