• 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

php - add comma thousands separator but remove trailing zeros

Alert message after submitting form in PHP

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu

Unable to create lockable file - Laravel 8 & PHP 8

I want to display a sweetalert after the inserting of data in my database

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

Get all WooCommerce products within own plugin

php code to send checkbox form results to email

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

Add rows to Single product Additional information table in WooCommerce 3.6

PHP rotate matrix counter-clockwise

Converting IPv6 to IPv4 address in PHP

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

About Contact Privacy policy Terms and conditions