• 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

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

how can I set a session variable in Drupal 8 and get it in a php script?

MySQL - Connection failed: No route to host

Testing subscription renewals on Stripe

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

Symfony autowiring issues since docker update

Symfony Make:Migration : The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

Eloquent insert id with sequence next value

PHPExcel export HTML table to xlsx

How to MODIFY a Google Docs document via API using search-and-replace?

Why does array_map() with null as callback create an "array of arrays"?

Sentry on Symfony: how to exclude `NotFoundHttpException`

Symfony Mercure "Failed to send an update"

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

How to validate tin and cst using PHP?

About Contact Privacy policy Terms and conditions