Hi there i have a value 1,2,3,4,5,6,7
and i want to change this value into 1,2,3,4
i don't want any value after 4 in my php code,
if you have any idea how to done it with PHP or Javascript
Hi there i have a value 1,2,3,4,5,6,7
and i want to change this value into 1,2,3,4
i don't want any value after 4 in my php code,
if you have any idea how to done it with PHP or Javascript
As you provided no efforts in writing code, here's a oneliner for you to understand:
echo implode(',', array_slice(explode(',', '1,2,3,4,5,6,7', 4 + 1), 0, 4));
Fiddle here.