Timepass with code
35 subscribers
3 photos
7 links
If you're looking for an enjoyable way to pass the time and develop some cool skills, why not try coding? You never know what you might be capable of creating!
Download Telegram
Channel created
#php
List Assignment in PHP

$string = "Martha:18";
[$name, $age] = explode(":", $string);
echo $name; // Output: Martha

Require php version >= 7.1

(If you are using older version then use list() construct )

$string = "Martha:18";
list($name, $age) = explode(":", $string);
echo $name; // Output: Martha