print-array tagged requests and articles

Categorized request examples and articles tagged with [print-array] keyword
How do I print an array in PHP?
To print or echo an array in PHP, you can use the print_r($variable, $return) or var_dump($variable1, $variable2, ...) functions. The print_r() function prints information about the passed variable in human-readable form. The first parameter is the "variable" we want to get information about. The second optional parameter determines whether the function should print or return the result. The default value is "False". If the parameter value is "True", the function will return the value as if it were printed to the output stream. The var_dump() function takes one or more arguments and displays structured information about the variables, including the type and value. In this Print PHP Array example, we use the print_r() function to print information about a given array. Below you can see more examples of PHP array printouts with a detailed description of each method. Click Execute to run the PHP Print Array Example online and see the result.