You could have seen a lot of programs in C language to print patterns. But a very few blogs / websites teaching how to print patterns in PHP. One of the blog is ours of-course.
In this blog, i am going to teach you how to print a right angled triangle in PHP.
Like this,
<?php
if($_GET){
$n = $i = $_GET['stars'];
while ($i--){
echo str_repeat('*', $n - $i)."<br>";
}
}
?>
<html>
<head></head>
<body>
<form>
Enter number of lines: <input type="text" name="stars" />
</form>
</body>
</html>You can see the demo here,

