How To Display Array Contents
how to display array contents
how, to, display, array, contents
How To Display Array Contents
Post Description: how to display array contents
POST# 447
Posted On: Fri Feb 29, 2008 12:01 pm
mysql
Topic: How To Display Array Contents
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


Mon Feb 11, 2008 2:23 pm
1
lucas
Reply #1035
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
)
Mon Feb 11, 2008 2:27 pm
2
hostman
Reply #1036
thanks..

you can get more information at

http://www.php.net/manual/en/function.array-values.php
Sat Feb 23, 2008 6:15 pm
3
tech support
Reply #1037
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));
Sun Feb 24, 2008 12:10 pm
4
Administrator
Reply #1038
take a look at this tutorial. it helped me alot

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

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload
     
  1. Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result
  2. Simple Array Example Learn PHP Programming Creating Arrays Learn Tutorial
  3. How To Create Make PHP Forms Using Form Arrays Tutorial
  4. How To Count And Break A Word Into An Array In Php Tutorial Guide
  5. How To Display Array Contents
  6. PHP Using For Loop To Display The Contents Of An Array
  7. How To Count Array Values Php Counting Arrays Holds Variables Script
  8. How To Use For Loop In Php Using Array Tutorial Sample Script
  9. Count And Display Words In A String Into Array Php Sentence Word
  10. How To Make Array Variable Global In PHP Function
  11. How To Count Elements In An Array Find How Many Values Arrays
  12. How To Check If Array Is Empty Or False Value
  13. How To Display Array Elements With Loop Get Show Array Values In PHP Tutorial
  14. How To Display Array Elements With FOR Loop
  15. Php Form Using Array For Field Name Template User Information
  16. Getting Array Elements Values With While Loop Show Display
  17. Display Array Elements Values With Loop
  18. How To Index Arrays And Show All The Elements And Values Of Array
  19. Php Show Values Array
  20. Php Html Display Array
  21. Making An Array From A Mysql Query