Online Programming Tutorials

PHP for array

Posted on: Aug 30, 2011 by admin 8 Comments

PHP for array is one of the most common and most usable tools in computer programming. But how to use PHP array?

In this article we will able to learn on how to use PHP array. Array is commonly use by most of developers due to the fact that in using arrays you can able to minimize your codes. Same as using a loop. This is also one of the thing that a programmer must have to know on how to manipulate data in an array. So, that we can attain this standard in system development and coding structure. There are some companies in the industry that really required to use array. So, why do we have to use array? we have to use an array to minimize the length of our code. The more and the longer our codes are the greater that time that the applications would process our data. It means that if we only have few codes or few lines of code it will be easier for the program to process that data and the faster the response is. Below is a sample code that illustrates to us on how to use an array in PHP.

Sample Code:


<?php
$array_name=array("firstname"=>"value1","lastname"=>"value2");

echo $array_name["firstname"];
echo $array_name["lastname"];
?>

This is a sample code on how to use array in a PHP. The firstname and the lastname are both the index name of the array. While the value1 and value 2 are the value that being store and the firstname and the lastname index. In the proceeding line of our code it illustrates on how to display the result from all array indexes. Which is the array variable name with and open and close bracket and quotes and inside are the indexes that we are going to call every time our program will execute. This is how PHP for array works. If there is some problem or questions regarding with this article, just CLICK THIS LINK to be redirected to the forum page. THANK YOU.
Tags: ,


8 Responses

  1. Very good data. Lucky me I reach on your site by accident, I bookmarked it.

  2. Jaylynn says:

    Well done aritlce that. I’ll make sure to use it wisely.

  3. Hey just wanted to give you a quick heads up and let you know a few of the pictures aren’t loading properly. I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both show the same outcome.

    • admin says:

      thank you for the comments. we will fixed this as soon as possible.

      Regards,

      Web Admin

    • admin says:

      can you site please if what post does the picture does not appear? so that we can fixed it as soon as possible to be able to give your more and appropriate article that can help you in your learning. thank you.

      regards,
      web admin

  4. You are a very intelligent individual!

  5. I was recommended this web site by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my problem. You’re incredible! Thanks!

  6. Great goods from you, man. I have understand your stuff previous to and you are just too excellent. I actually like what you have acquired here, certainly like what you’re stating and the way in which you say it. You make it enjoyable and you still take care of to keep it sensible. I can not wait to read far more from you. This is really a great website.

Leave a Reply