<?php $input = ['1, 2, 3, 4, 5', 'test', 3, '100, a, test']; foreach ($input as $item) { if (is_string($item)) { foreach (explode(',', $item) as $i) { if (is_numeric($i)) { echo trim($i) . PHP_EOL; } } } }
You have javascript disabled. You will not be able to edit any code.