Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOpsSchool!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to print a star pattern in PHP embedded in HTML? -6

How to print a star pattern in PHP?

What is star pattern?

Star Pattern is the series of such character like (*) or another characters can be used to print to create geometrical shapes.

Logic:

  1. Input number of rows(i) to print from user given $num.
  2. To iterate through rows(i) run an outer loop from 0 to $num with for loop.
  3. To iterate through columns(j) run an inner loop form 1 to $i with for loop.
  4. After printing all columns(j) of a row move to next line.

Right Triangle Star Pattern coding:

Entering a number:

Input number is 6
Output of 6

Thanks

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.