Skip to content
Advertisement

get value 1 – 2 – 1 – 2 – 1 in for loop php

I am trying to get value like 1-2-1-2-1-2 from for loop

I tried code like this

JavaScript

where $currentPage = 5; $c =2;

when $c = 3; the value should be 1-2-3-1-2-3 when i echo $b or dd($b) out of loop i will got 12111 but i need answer 121212 please help me to solve this.

Advertisement

Answer

Is this what you want?

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement