Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is array and the the use of it?can someone explain to me?
#3
An array is used as an alternative to using multiple variables to hold values.

PHP Code:
<?PHP

$array 
= ("One""Two""Three"); //Define the array
Echo $array[0]; //Will echo "One"
Echo $array[2]; //Will echo "Three"

foreach ($array as $value){
Echo 
"$value, "//Will echo "One, Two, Three, "
}
?>
[Image: cooldude.png]

(09-05-2011, 08:36 AM)Orgy Wrote: If you understand what you're doing, you aren't learning anything. ;)
Reply


Messages In This Thread
RE: What is array and the the use of it?can someone explain to me? - by ★Cooldude★ - 10-30-2011, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Put the data from a MySQL column in an array RPicard 3 1,076 06-01-2010, 01:51 PM
Last Post: RPicard
  $_POST array is empty RPicard 3 1,446 05-31-2010, 03:35 PM
Last Post: RPicard
  PHP Array Help Dutchcoffee 2 967 03-01-2010, 10:03 PM
Last Post: Dutchcoffee
  Array Condition on MyBB Forums (PHP Enabled) Rafael 4 1,345 02-09-2010, 06:36 AM
Last Post: Rafael

Forum Jump:


Users browsing this thread: 2 Guest(s)