1 |
echo substr("abcabcabc", 0, -3); |
or
1 |
echo substr($string, 0, strlen($string) - 3); |
1 |
$HTTP_RAW_POST_DATA |
instead of
1 |
$_POST |
It will give you POST data as is. You will be able to decode it using
1 |
json_decode() |
later
1 |
{$foo|@print_r} |
The output look like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<div> kicks brand kicks brand kicks brand kicks brand </div> <div> kicks brand kicks brand kicks brand kicks brand </div> <div> kicks brand kicks brand kicks brand kicks brand </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$count = 1; foreach( $array_var as $var ) { if ($count%4 == 1) { echo "<div>"; } // Code if ($count%4 == 0) { echo "</div>"; } $count++; } if ($count%4 != 1) echo "</div>"; //This is to ensure there is no open div if the number of elements in user_kicks is not a multiple of 4 |