

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP program to print continuous character pattern triangle
To print continuous character pattern triangle in PHP, the code is as follows −
Example
<?php function continuous_alphabets($val) { $num = 65; for ($m = 0; $m < $val; $m++) { for ($n = 0; $n <= $m; $n++ ) { $ch = chr($num); echo $ch." "; $num = $num + 1; } echo "\n"; } } $val = 6; continuous_alphabets($val); ?>
Output
A B C D E F G H I J K L M N O P Q R S T U
This is similar to generating a star or a number pattern, the only difference being, continuous characters of English alphabets are generated instead of stars or numbers. The function ‘continuous_alphabets’ is defined that takes the limit as a parameter. The limit value is iterated over and the character is printed and relevant line breaks are also generated in between. The function is called by passing this limit value and the relevant output is generated on the console.
- Related Questions & Answers
- PHP program to print continuous numbers in the form of triangle
- Java Program to Print Left Triangle Star Pattern
- Java Program to Print Upper Star Triangle Pattern
- Java Program to Print Downward Triangle Star Pattern
- Java Program to Print the Left Triangle Star Pattern
- Java Program to Print Mirror Lower Star Triangle Pattern
- Java Program to Print Mirror Upper Star Triangle Pattern
- Java Program to Print Hollow Right Triangle Star Pattern
- PHP program to print the number pattern
- PHP program to print a pattern of pyramid
- Program to print an inverse pyramid character pattern in C++
- Print symmetric double triangle pattern in C language
- Python program to print number triangle
- Program to print Interesting pattern in C++
- Program to print Kite Pattern in C++
Advertisements