Fun at zangOOr Click Here
1 like 0 dislike
69 views
I have a data in a array

$array = array('a','b','c','d','e','f','g','h','i','j');

need output like this

1a 1b 1c 1d 2e 2f 2g 2h 3i 3j
in Education & Reference by (640 points) | 69 views

1 Answer

0 like 0 dislike
Best answer
$array = array('a','b','c','d','e','f','g','h','i','j');

echo "<pre>";
print_r($array);
$count = count($array);

for($i = 0; $i < $count; $i++)
{
$quotient = (int)($i / 4);
$num = ($quotient + 1);
$data[] = $num."".$array[$i]; 
}
echo implode(" ", $data);
by (3.3k points)

Related questions

2 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Aug 2, 2018 in Education & Reference by Sam (1.4k points) | 120 views
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Jan 4, 2018 in Education & Reference by Sam (1.4k points) | 642 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked May 30, 2019 in Education & Reference by Marc (3.3k points) | 143 views

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,245 questions
1,400 answers
565 comments
4,809 users