Home -
PHP- Splitting
This php script shows string splitting using the substr function. substr
/*
FluidCoding - Splitting
Author: Tonic
*/
<?php
$string = "1234abcd"; //Our string
$split = substr($string, 0, 4);
//Splits the string, reads from the first character(1) to 4
echo $split; //Echos 1234
?>
Output
1234