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?
#1
I have read some php tutorials i have stucked in arrays.

so would someone teach me about arrays?what is it and where is usefull?
www.advertise4you.info

Its an promotion forum with a lot of seo tutorials,you can register and you can start advertise your site by registering.It also contains:

Search engine optimization|Free Posting Packages |Graphics |Games
Reply
#2
Arrays are a very usefull feature in PHP and you'll find yourself using then more than you think. An array is just a fancy term for storing multiple data in a single variable. Take the $_POST variable, it's an array and contains the data that was sent in a form, you access that data by using its unique id. Eg, $_POST["username"] contains the data sent that has the unique identifier of "username".

Do you seem to understand now?
Google probably has a much better explanation than me though, haha.
Reply
#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


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: 1 Guest(s)