1 / 34

PHP

PHP. 1 12 123 1234 12345 http://www.thaiall.com/php/training49.htm http :// www.thaiall.com/article/teachpro.htm Update : August 23,2012. PHP. My case was in Foxserv Server Suit 1. http ://sourceforge.net/projects/foxserv/ [FoxServ3.1Beta1.exe]

amena-beach
Download Presentation

PHP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP 1 12 123 1234 12345 http://www.thaiall.com/php/training49.htm http://www.thaiall.com/article/teachpro.htm Update : August 23,2012

  2. PHP My case was in Foxserv Server Suit 1. http://sourceforge.net/projects/foxserv/ [FoxServ3.1Beta1.exe] 2. Change [foxserv] in httpd.conf to [easyserv] 3. Press Go for PHP 4.2.2 and Apache 1.3.27 4. Root in C:\FoxServ\www 5. http://127.0.0.1/x.php Question How do you write 1 – 5 in separate lines? Remark One to five in x.php On webserver that support PHP Language

  3. This source code in x.php was not the answer 1 2 3 4 5

  4. This source code in x.php was not the answer <? echo " 1 2 3 4 5 "; ?>

  5. ok <pre><? echo " 1 2 3 4 5 "; ?></pre>

  6. ok 1<br>2<br>3<br>4<br>5

  7. ok <pre> 1 2 3 4 5 </pre>

  8. no <? echo "1"; echo "2"; echo "3"; echo '4'; echo '5'; ?>

  9. ok <? echo "1<br>"; echo "2<br>"; echo "3<br>"; echo '4<br>'; echo '5<br>'; ?>

  10. no <pre><? echo "1\n"; echo "2\n"; echo "3\n"; echo '4\n'; echo '5\n'; ?></pre>

  11. ok <pre><? echo " 1\n 2\n 3\n 4\n 5\n "; ?></pre>

  12. ok <pre><? echo "1\n2\n3\n4\n5\n"; ?></pre>

  13. ok <? echo ++$i . "<br>"; ?> <? echo ++$i . "<br>"; ?> <? echo ++$i . "<br>"; ?> <? echo ++$i . "<br>"; ?> <? echo ++$i . "<br>"; ?>

  14. no ..It was not error and warning If you do not declare <? echo $i++."<br>"; echo $i++."<br>"; echo $i++."<br>"; echo $i++."<br>"; echo $i++."<br>"; ?>

  15. ok <pre><? for($i=1;$i<=5;$i++) echo "$i\n"; ?></pre>

  16. ok <ol><? for($i=1;$i<=5;$i++) echo "<li>"; ?></ol>

  17. ok <? for($i=1;$i<=5;$i++) echo "$i<br>"; ?>

  18. no <? for($i=1;$i<5;$i++) { echo "$i<br>"; } ?>

  19. ok <? for($i=1;$i<=5;$i++) { ?> <? echo "$i<br>"; ?> <? } ?>

  20. ok <? for($i=1;$i<=5;$i++) { ?> <? echo "$i"; ?> <br> <? } ?>

  21. ok <? for($i=1;$i<=5;$i++) { ?> <?=$i?> <br> <? } ?>

  22. ok <pre> <? for($i=1;$i<=5;$i++) { ?> <?=$i."\n";?> <? } ?> </pre>

  23. ok <pre><? for ($i=49;$i<54;$i++) echo chr($i).chr(10); ?></pre>

  24. ok <? $s ="12345"; for($i=0;$i<5;$i++) echo substr($s,$i,1)."<br>"; ?>

  25. ok <? foreach (range(1,5) as $x) { echo "$x<br>"; } ?>

  26. ok <? $a = array(1,2,3,4,5); foreach ($a as $x) { echo "$x<br>"; } ?>

  27. no <? $i = 0; while ($i <= 5) { echo $i; echo "<br>"; $i = $i + 1; } ?>

  28. ok <? $i = 1; while ($i <= 5) echo $i++ ."<br>"; ?>

  29. ok <? $i = 1; while ($i <= 5) { echo $i++ ."<br>"; } ?>

  30. ok <? $i = 1; ?> <? while ($i <= 5) { ?> <? echo $i; ?> <? echo "<br>"; ?> <? $i = $i + 1; ?> <? } ?>

  31. no <? while (true) { if ($i >= 5) break; else print $i++ . "<br>"; } ?>

  32. no <? $s = "1,2,3,4,5"; $a = explode( ',', $s); $i=1; do { echo $a[$i++]."<br>"; } while ($i < 5); ?>

  33. no <? do { echo $i++."<br>"; } while ($i < 5); ?>

  34. ok <? do { echo $i++."<br>"; if($i > 5) break; } while (true); ?>

More Related