|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-06-25 10:13 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2019-06-25 10:13 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 13:00:02 2026 UTC |
Description: ------------ Hi, using PHP Version 7.1.12 when i am tring to printing Pattern like * * * * * * * * * * * * * * * my code <?php for($i=1;$i<=5;$i++){ for($k=5;$k>$i;$k--){ echo " "; //echo " "; } for($j=1;$j<=$i;$j++){ echo "*" ; } print "<br/>"; } ?> in the second loop my first echo giving me output like * ** *** **** ***** which is not as expected when i go with second echo code below for($i=1;$i<=5;$i++){ for($k=5;$k>$i;$k--){ //echo " "; echo " "; } for($j=1;$j<=$i;$j++){ echo "*" ; } print "<br/>"; } ?> i get my desired output like * ** *** **** ***** strange both echo syntax is same why first echo not working.please help me Test script: --------------- * ** *** **** *****