Skip to content

Instantly share code, notes, and snippets.

@kangarie
Created September 23, 2022 12:08
Show Gist options
  • Save kangarie/0f3674413d20401a6240230c6ebe7646 to your computer and use it in GitHub Desktop.
Save kangarie/0f3674413d20401a6240230c6ebe7646 to your computer and use it in GitHub Desktop.
PHP script to draw a triangle of wildcard
<?php
$n = 5;
for($i=1;$i<=$n;$i++) {
for($j=1;$j<=$i;$j++) echo "*";
echo "\n";
}
/*
output
*
**
***
****
*****
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment