how to print this pattern in php.

A A,B A,B,C

Your Answer

<?php
$b ="ABCDE";
 $a = strlen($b);
for($i=0;$i<$a;$i++)
{
    for($j=0;$j<=$i;$j++)
    {
        echo $b[$j];
if($i==$j)
{
echo "";
}
else
{
echo ",";
}
}
echo "<br>";
}

?>

 

Php

Didn't get the answer.
Contact people of Talent-Php directly by clicking here