2 ways of printing an array in php

2 ways of printing an array in php

PHP provides two very useful functions that can be used to output a variable’s value recursively called print_r() and var_dump(). - Create An Array: $my_array = array("elem_1","elem_2","elem_3"); - Using Print_r() function: Print_r() can return its output as a string, as opposed to writing it to the scripts standard output print_r($my_array); // Output: // Array ( [...]
Back To Top
Cool Ajax - Web Development Tutorial Blog
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.