• 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

Laravel Excel::store file empty after stored

enroll_table three field fetch to payment form to create payment field in laravel 5.5

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

Laravel 8 factory state afterCreating

Laravel display validation error

Show date difference as "20" instead of "20 years ago"

Currently Using CodeIgniter Framework i have an Error

Debugging Stripe Webhook Event

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

WordPress - Dynamically add user ID to the end of a URL

How to override header set in Apache config with more specific header in a virtual host

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

javascript html popup window

Edit XML in HTML form and submit to self

How to create a individual template for page or post in custom plugin?

About Contact Privacy policy Terms and conditions