About 1,950,000 results
Open links in new tab
  1. for loop - Printing a number triangle pattern with PHP - Stack Overflow

    Jan 31, 2017 · SOLUTION 1: collect numbers to an array and echo it at the end. foreach(range($from,$to+$k) as $v){ $results[$k][] =$v; $results[$k] = implode($spaceChr, …

  2. PHP Program to print Triangle number - The Code Developer

    Oct 1, 2017 · In this article write a PHP program to print triangle number. Using for loops, nested for loop and if condition to print Floyd number.

  3. PHP Number Triangle Program - Tpoint Tech - Java

    Mar 10, 2025 · Number triangle in PHP can be printed using for and foreach loop. There are a lot of patterns in number triangle. Some of them are show here. <?php $k=1; for ($i=0;$i<4;$i++) { …

  4. PHP Program to Check Triangular Number | CodeToFun

    Oct 31, 2024 · Let's take a look at the php code that checks and displays triangular numbers in the range of 1 to 50. Run the script to see the triangular numbers in the range from 1 to 50. …

  5. PHP program to calculate the area of an equilateral triangle

    Nov 20, 2021 · PHP program to calculate the area of an equilateral triangle. There are you will learn how to find the area of an equilateral triangle in PHP language. Formula: a = (sqrt(3) / 4) …

  6. Triangle Checker - PHP Exercises

    // checking if it is equilateral. var_dump(triangleChecker(2, 2, 2)); var_dump('equilateral'); var_dump(triangleChecker(10, 10, 10)); var_dump('equilateral'); // checking if it is isosceles.

  7. PHP for loops - W3Schools

    The PHP for Loop. The for loop is used when you know how many times the script should run. Syntax for (expression1, expression2, expression3) { // code block} This is how it works: …

  8. php - How can I print integer in triangle form - Stack Overflow

    Jan 23, 2016 · It's an unorthodox use of a "for" loop, but it's still perfectly valid and arguably makes the code more elegant and easier to follow. I chose to add space before and after each …

  9. web - I want to print triangle in stars pattern in PHP can anyone …

    Feb 21, 2017 · You need to add spaces/padding around the * so the triangle forms. This will work, still uses two for loops: $spaces = ""; for($b = (5 - $a); $b>1; $b--) $spaces .= " "; echo …

  10. How to create an equilateral triangle made of lines using for loops ...

    I'm trying to draw a triangle made of lines using a for loop, but all I can get are triangles with sides that are not equilateral. How do I do this? I've attached my code below: size(500,500); …

  11. Some results have been removed
Refresh