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.
solved PHP How to remove all value after 4 comma in php
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.
solved PHP How to remove all value after 4 comma in php