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

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...