PHP Picture Counter Example Tutorial

Source: Internet
Author: User
Keywords Web Programming PHP Tutorials
Tags array counter example file open file php programming read

With the counter of the beautiful, we often use pictures to do statistics of the number 1,2 to 10 we just do 0,9 picture number, and then use the following method to make beautiful counter out oh.

$fp = fopen ($countfile, "R"); Open a file in read-only mode
$array _count = 1; Defines a variable that represents the position of an array element, with the following
while (! feof ($fp)) {
$current _number = fgetc ($FP);
$counter _array[$array _count] = $current _number;
$array _elements = count ($counter _array);
$array _count = $array _count + 1;
}
Display code
Echo ("<table border=" 0 "height=" 5 "align=" left "><tr><td align=" center "> Welcome you, section");

for ($array _id = 1; $array _id < $array _elements + + $array _id) {
Echo ("<img src="./img/$counter _array[$array _id].gif "align=absmiddle>");
}

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.