Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // for ($i = 1; $i <= 100; $i++)
- // {
- // echo $i. '. line '.$i."<br>";
- // }
- // $studentArr = array (
- // "Arabi" => 3.66,
- // "Larabi" => 2.66,
- // "Marabi" => 3.70,
- // "Sohan" => 4.00,
- // "Mohan" => 3.66,
- // "Afif" => 3.66,
- // );
- //
- // foreach ($studentArr as $key => $value)
- // {
- // echo "Student Name: [" . $key. "] and CGPA: [".$value." ]<br>";
- // }
- // top half of the diamond
- for ($row = 1; $row <= 5; $row++) {
- for($space = 1; $space <= 5 - $row; $space++) {
- echo "  ";
- }
- for($star = 1; $star <= 2 * $row - 1; $star++) {
- echo "*";
- }
- echo "<html><br><html>";
- }
- for ($row = 4; $row >= 1; $row--) {
- for($space = 1; $space <= 5 - $row; $space++) {
- echo "  ";
- }
- for($star = 1; $star <= 2 * $row - 1; $star++) {
- echo "*";
- }
- echo "<html><br><html>";
- }
- ?>
Add Comment
Please, Sign In to add comment