Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

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

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals

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.