Show name using php
<?php
$str = "rupesh";
$strLength = strlen($str);
for($i=0; $i<=$strLength; $i++){
for($j=0; $j<$i; $j++){
echo $str[$j];
}
echo "<br/>";
}
?>
<!DOCTYPE html>
<html>
<body>
<?php
$str2 = "Rupesh";
$strlength = strlen($str2);
for($i=$strlength; $i>=0; $i--){
for($j=0; $j<=$i; $j++){
echo $str2[$j];
}
echo "<br/>";
}
?>
</body>
</html>
Comments
Post a Comment