How to print subscript _php tutorial with PHP array

Source: Internet
Author: User
When learning PHP arrays, you may encounter a lot of problems, here will introduce the problem of PHP array solution, here to share with you. Started to learn PHP. It has been subjectively assumed that programming refers to writing applications in languages such as c,c++. For Web pages have always been at a respectful distance. However, as a system administrator, if you want to maintain the site is PHP, light energy solution system problem is not enough, in order to solve the needs or need to understand some of the PHP syntax.

So the "sneak" look at PHP. During the learning process, PHP can also write scripts. Isn't that the same thing? I only learn this part of the PHP script, used for system management, so that you can become familiar with PHP syntax, when necessary to modify some of the pages. Do not know the use of PHP scripts for system Management, I am not the first person, hey, can solve the problem is the kingly.

Because of the workflow reason, the colleague writes the thing, needs me to update to the server, then the colleague sees the effect again. There is no problem with this operation. But for colleagues, it is possible to change something every time, always "trouble" me, I will feel guilty. And I, in order to save things, the colleague let me do something, wrote a script, he let me update when I connect to the server, directly execute the script is OK.

So I was thinking, "How can I get my colleagues to do this directly without me?" It is unrealistic to open permissions on the server, because the smaller the server administration permissions, the better. In the Department of the boss proposed to write a page to let colleagues do this thing, I said I have this idea, but the process is not written page click button. The boss said, this simple, so, come over three five in addition to two, a only one button, click can be executed after the output of the page is written. And this button can be unlimited number of clicks. This eliminates the hassle of re-accessing this page every time. After giving it to a colleague, guess what? Colleagues unexpectedly excited to say: "You this small innovation, really benefit all mankind ah!" Haha, although I did not say anything, in fact, the heart early joy opened the flowers. This is my beginner php a little bit of encouragement, come on!

Nonsense, in fact, I just want to share with you PHP how to print array subscript. When I see the foreach function of PHP, I think it has a spell with Perl's foreach, but when I open a file and output it, I want to print out the label for each line. Perl has more than n built-in functions to implement this function with $. Can't php implement it? Search for half a day without fruit, asked a few people who write PHP just said to define a variable in advance, and then print the variable. There seems to be no way, so continue to look down on the grammar. When you see a two-dimensional array. Once accidentally a one-dimensional array in accordance with the two-dimensional array of the wording of the printed out, and then found that the secret to say! Look at the picture:

498) this.width=498; ' OnMouseWheel = ' javascript:return big (This) ' onclick= ' window.open ("http://blog.php100.com/ viewpic.php?refimg= "+ this.src) ' alt=php array src=" Http://www.bkjia.com/uploadfile/2013/0904/20130904094734447.jpg " Border=0>


Needless to say, create a PHP array of 10 numbers and output the results.

498) this.width=498; ' OnMouseWheel = ' javascript:return big (This) ' onclick= ' window.open ("http://blog.php100.com/ viewpic.php?refimg= "+ this.src) ' alt= array subscript src=" Http://www.bkjia.com/uploadfile/2013/0904/20130904094734660.jpg " Border=0>

Do you see the results? Did you print the array subscript correctly? It seems that PHP is also very powerful, very yellow very violent said. Today's share is here, not a small dessert, at best is heterodoxy:)


http://www.bkjia.com/PHPjc/446453.html www.bkjia.com true http://www.bkjia.com/PHPjc/446453.html techarticle When learning PHP arrays, you may encounter a lot of problems, here will introduce the problem of PHP array solution, here to share with you. Started to learn PHP. has been subjectively recognized ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.