How To Display Array Contents In Php With A Simple Function

Forums » PHP » How To Display Array Contents In Php With A Simple Function
This Page Contains information about How To Display Array Contents In Php With A Simple Function By mysql with 5 Replies. Last Upated: Fri Apr 11, 2014
i want to know how i can display or show the contents or the values of an array into one whole output.

for example if i have an array with 5 different values, how can i display what that array holds?

thanks
lucas
lets say you have something like this:

<?php
$array = array("size" => "XL", "color" => "gold");
echo '<pre>';
print_r(array_values($array));
echo '</pre>';
?>


you will have something like this come out:
OUTPUT:
Array
(
    [0] => XL
    [1] => gold
)
wallpaperama
thanks..

you can get more information at

http://www.php.net/manual/en/function.array-values.php
tech
if you want display from mysql query you can us this one:


$sql = "SELECT * FROM ".$db_prefix."config";
$result = mysql_query($sql ,$db);
$myrow = mysql_fetch_array($result);
print_r(array_values($myrow));

http://wallpaperama.com/forums/how-to-display-array-contents-t5714.html
Administrator
take a look at this tutorial. it helped me alot

how-to-index-arrays-and-show-all-the-elements-and-values-of-array

Bhargb
Plz reply me of this problem..................
Title: How To Display Array Contents In Php With A Simple Function [1078]
Tags: how to display array contents
By , 5 Comments