How To Display Array Contents

RegisterLogin
How To Display Array Contents
Post Description: How To Display Array Contents
Tags: How, To, Display, Array, Contents
This Post Was Posted On Feb 29, 2008 By mysql #1288
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
Administrator
#1719 1
take a look at this tutorial. it helped me alot

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

Feb 24, 2008 Reply Report abuse
tech support
#1718 2
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));
Feb 23, 2008 Reply Report abuse
hostman
#1717 3
thanks..

you can get more information at

http://www.php.net/manual/en/function.array-values.php
Feb 11, 2008 Reply Report abuse
lucas
#1716 4
lets say you have something like this:



<?php

$array = array("size" => "XL", "color" => "gold");

print_r(array_values($array));

?>





you will have something like this come out:


OUTPUT:
Array

(
[0] => XL
[1] => gold
)
Feb 11, 2008 Reply Report abuse
Leave Your Comments...
©2012 Webune Forums - Sat Dec 15, 2012 6:41 pm
Powered by: Webune Forums V3