June 10, 2015

PHP list() function example

Below is the PHP list() function with example:

<!DOCTYPE html>
<html>
<body>

<?php
$my_array = array("car","bike","cycle");

list($a, , $c) = $my_array;
echo "This is the $a and $c variables.";
?>

</body>
</html>

Output is:

This is the car, bike, cycle.

Enjoy!

No comments:

Post a Comment

1980s Photo Prompts: Easy Online Copy & Paste

Are you on a quest to enhance your photography projects with a touch of nostalgic flair? Look no further than 1980s photo prompts. These car...