IT Community - Software Programming, Web Development and Technical Support

Using Arrays in PHP

This is a discussion on Using Arrays in PHP within the PHP Programming forums, part of the Web Development category; In the products array, we allowed PHP to give each item the default index. This meant that the first item ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read

Reply
 
Thread Tools Display Modes
  #131  
Old 04-16-2009, 10:38 PM
Pieter Stefanus Pieter Stefanus is offline
D-Web Trainee
 
Join Date: Apr 2009
Posts: 21
Pieter Stefanus is on a distinguished road
Default Re: Using Arrays in PHP

In the products array, we allowed PHP to give each item the default index. This meant that the first item we added became item 0, the second item 1, and so on. PHP also supports associative arrays. In an associative array, we can associate any key or index we want with each value.
The following code creates an associative array with product names as keys and prices as values.
Initializing
$prices = array( 'Tires'=>100,
'Oil'=>10, 'Spark Plugs'=>4 );
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #132  
Old 07-06-2009, 06:34 AM
gold4282 gold4282 is offline
D-Web Trainee
 
Join Date: Jun 2009
Posts: 8
gold4282 is on a distinguished road
Unhappy Nice!!!

Nice........

Last edited by arjkhanna : 07-06-2009 at 09:54 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #133  
Old 09-25-2009, 11:23 PM
garuav123456 garuav123456 is offline
Banned
 
Join Date: Sep 2009
Posts: 31
garuav123456 is on a distinguished road
Default Re: Using Arrays in PHP

If you want any help related with PHP and other web development programming language than search web development in google hear you get best information.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #134  
Old 12-02-2009, 03:57 PM
thunder001jet thunder001jet is offline
D-Web Trainee
 
Join Date: Dec 2009
Posts: 1
thunder001jet is on a distinguished road
Default Re: Using Arrays in PHP

Hello, Thanks to all your information it will very helpful to us... keep it up the good work guys
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Jagged Arrays in C# vigneshgets C# Programming 4 09-30-2008 03:48 AM
Using arrays in stored procedures it.wily Database Support 2 02-09-2008 09:18 AM
Classic asp arrays and recordset ramesh123 ASP and ASP.NET Programming 1 12-02-2007 07:44 PM
Arrays in Java leoraja8 Java Programming 7 11-19-2007 12:23 AM
Java:Tutorial - Arrays pranky Java Programming 0 02-23-2007 11:54 PM


All times are GMT -7. The time now is 07:35 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0