Quick Writer
Welcome to Questions & Answers on Math, Physics, Chemistry, History and more, where you can ask questions and receive answers from other members of the community.

How to create an array with php

I need to create an example with my PHP assignment - create simple array and print it. Could you help?
asked Jul 7, 2017 in PHP by Wendy

1 Answer

 
Best answer

Here is an example of php array:

<?php
$fruits = array("Apple", "Grape", "Banana");
echo "I like " . $fruits[0] . ", " . $fruits[1] . " and " . $fruits[2] . ".";
?>

You can find more examples here http://php.net/manual/en/language.types.array.php

answered Jul 7, 2017 by Jack
How to echo array?
...