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

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...