Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php split array in half

$alphabet = array("a", "b", "c", "d", "e","f");

$firsthalf = array_slice($alphabet, 0, count($alphabet) / 2);
$secondhalf = array_slice($alphabet, count($alphabet) / 2);
Comment

PREVIOUS NEXT
Code Example
Php :: get url link in php 
Php :: laravel-medialibrary change name of file 
Php :: install php 8 ubuntu 
Php :: How to Manually Upgrade phpMyAdmin on Ubuntu 
Php :: Class "AppHttpControllersAdminAuth" not found 
Php :: Deleting an element from an array in PHP 
Php :: excel extract date from dd mm yyyy laravel blade 
Php :: php const 
Php :: php mkdir with 777 permission 
Php :: PHP (WordPress) - Increase Maximum Upload File Size 
Php :: iteration in php 
Php :: php check if any of multiple values in array 
Php :: laravel exists eloquent 
Php :: lluminate/contracts[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 - your php version (8.0.10) does not satisfy that requirement. 
Php :: php combine arrays 
Php :: php random number generator 
Php :: woocommerce profile photo upload 
Php :: laravel-ckeditor 
Php :: php array map cast to int 
Php :: laravel redirect with message to section 
Php :: laravel migrate refresh specific migration 
Php :: install php 7.3 ubuntu 
Php :: how to go to another folder in php 
Php :: allowed memory size of bytes exhausted composer 
Php :: enque scripts from plugin 
Php :: php checking if array is multidimensional or not 
Php :: Add new column to table in mysql using php 
Php :: foreach reverse laravel 
Php :: php check session status 
Php :: string convert snake case to title case in laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =