I want to print array using pre tag in php, how can i do it?
my arrays are !
$array = array('red', 'pink', 'blue', 'white');
Sir please tel me how I print as array
You can print array as:
1. print_r($array);
2. Using <pre>
tag as echo '<pre>'; print_r($array); echo '</pre>';
3. var_dump($array);
Using for get mata information about array such as data tipe length and other
4. You can loop the array using php's foreach();
function get the desired output.
If you still have a question about this, submit it in our Q&A community - Ask Question