PHP Tutorials - How To Make Create A Simle Array Single Dimentional Arrays
RegisterLogin
PHP Tutorials - How To Make Create A Simle Array Single Dimentional Arrays
Post Description: PHP Tutorials - How To Make Create A Simle Array Single Dimentional Arrays
Tags: PHP, Tutorials, -, How, To, Make, Create, A, Simle, Array, Single, Dimentional, Arrays
This Post Was Posted On Feb 29, 2008 By web hosting #1224
Post Description: PHP Tutorials - How To Make Create A Simle Array Single Dimentional Arrays
Tags: PHP, Tutorials, -, How, To, Make, Create, A, Simle, Array, Single, Dimentional, Arrays
This Post Was Posted On Feb 29, 2008 By web hosting #1224
PHP Tutorials - How To Make Create A Simle Array Single Dimentional Arrays by web hosting
so here is an example code script you can use to see how a single dimesional arrays works:
Lets say i have a choice of 5 cities, all starting with "San" so here are my five cities:
1. San Francisco
2. San Diego
3. San Fernando
4. San Antonio
5. San Bernandino
So i want my script to display a message that say "I live in San Antonio"
this is how the script would look like:
Code:
<?php
$cities[0] = "San Francisco";
$cities[1] = "San Diego";
$cities[2] = "San Fernando";
$cities[3] = "San Antonio";
$cities[4] = "San Bernandino";
print ("I live in $cities[3].<br>");
?>
$cities[0] = "San Francisco";
$cities[1] = "San Diego";
$cities[2] = "San Fernando";
$cities[3] = "San Antonio";
$cities[4] = "San Bernandino";
print ("I live in $cities[3].<br>");
?>
Output:
Code:
I live in San Antonio.
REMEMBER: You will need a website with php, i you don't have php already, signup with www.webune.com with one of their PHP plans.
Another tool you can use is notepad to create script. open your notepad and copy and paste it into notepad and save it as arrays.php and upload to your php webiste to see it in action.
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Mon Dec 19, 2011 5:03 pm
Powered by: Webune Forums V3
Powered by: Webune Forums V3