-2

I'm trying to get the checked values into a PHP array so that I am able to loop through the array but I can't seem to convert it to an array.

jQuery Ajax Posts

checked=28,24

PHP

$checked = $_POST['checked'];

$arr = array($checked);
print_r($arr);

OUTPUT

Array
(
    [0] => 28,24
)

1 Answer 1

2

Use explode function to convert comma separated string to an array,

$arr = explode(",",$checked);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.