Answers for "php explode and get first value"

PHP
0

php explode and get first value

$beforeDot = array_shift(explode('.', $string));
$beforeDot = current(explode(".", $string));

// PHP <= 5.3:
$beforeDot = explode(".", $string);
$beforeDot = $beforeDot[0];
Posted by: Guest on April-17-2021

Code answers related to "php explode and get first value"

Browse Popular Code Answers by Language