Convert a comma-delimited string into array of integers?

You can achieve this by following code,

$integerIDs = array_map('intval', explode(',', $string));

Leave a Comment