Loop from start to end to start in php

Zakeer Hussain

how to print below format using only one for loop. Please tell is it possible to do this ?

1
12
123
1234
12345
1234
123
12
1
kainaw

There are hundreds of ways to do it. This is just one:

for($i=-4; $i<5; $i++)
    print substr('12345', 0, 5-abs($i))."\n";

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

loop from end to start

From Dev

loop from end to start

From Dev

PHP Start loop in one function and end it in another?

From Dev

how can i run the loop from start date to end date for every 3 months in php

From Dev

how can i run the loop from start date to end date for every 3 months in php

From Dev

How to start a for loop from the end of a vector, and at the value 0 do something

From Dev

How to make a for loop to start from anywhere and end it same position?

From Dev

How to start from a certain row and end in a certain row in mysql PHP?

From Dev

Partion 20 min slot of time in php from start and end time

From Dev

PHP Regex to find a substring from a big string - Matching start and end

From Dev

PHP - Remove all punctuation from the start and end of the string

From Dev

PHP - Remove all punctuation from the start and end of the string

From Dev

How to start/end a background process from PHP/bash script?

From Dev

PHP Regex end operator to be 6th from the start

From Dev

Partion 20 min slot of time in php from start and end time

From Dev

PHP Regex to find a substring from a big string - Matching start and end

From Dev

Parse json from End to Start

From Dev

Defining the start and end point of a loop in bash

From Dev

For start To end Loop with end Variable Changing Mid-Loop

From Dev

Query to obtain start and end dates from table with only start dates

From Dev

PHP Searching Array for Start and End point of values

From Dev

set time start and end with php script

From Dev

PHP Searching Array for Start and End point of values

From Dev

Jumping from start to end of code block - vim

From Dev

Start and end date from date range

From Dev

Create range of years from start to end.

From Dev

Regex start searching from the end of the string (reverse)

From Dev

Start reading data in query from end (of file)

From Dev

Fullcalendar start end time from json feed

Related Related

  1. 1

    loop from end to start

  2. 2

    loop from end to start

  3. 3

    PHP Start loop in one function and end it in another?

  4. 4

    how can i run the loop from start date to end date for every 3 months in php

  5. 5

    how can i run the loop from start date to end date for every 3 months in php

  6. 6

    How to start a for loop from the end of a vector, and at the value 0 do something

  7. 7

    How to make a for loop to start from anywhere and end it same position?

  8. 8

    How to start from a certain row and end in a certain row in mysql PHP?

  9. 9

    Partion 20 min slot of time in php from start and end time

  10. 10

    PHP Regex to find a substring from a big string - Matching start and end

  11. 11

    PHP - Remove all punctuation from the start and end of the string

  12. 12

    PHP - Remove all punctuation from the start and end of the string

  13. 13

    How to start/end a background process from PHP/bash script?

  14. 14

    PHP Regex end operator to be 6th from the start

  15. 15

    Partion 20 min slot of time in php from start and end time

  16. 16

    PHP Regex to find a substring from a big string - Matching start and end

  17. 17

    Parse json from End to Start

  18. 18

    Defining the start and end point of a loop in bash

  19. 19

    For start To end Loop with end Variable Changing Mid-Loop

  20. 20

    Query to obtain start and end dates from table with only start dates

  21. 21

    PHP Searching Array for Start and End point of values

  22. 22

    set time start and end with php script

  23. 23

    PHP Searching Array for Start and End point of values

  24. 24

    Jumping from start to end of code block - vim

  25. 25

    Start and end date from date range

  26. 26

    Create range of years from start to end.

  27. 27

    Regex start searching from the end of the string (reverse)

  28. 28

    Start reading data in query from end (of file)

  29. 29

    Fullcalendar start end time from json feed

HotTag

Archive