$push = $result; $push = json_decode($push, true); foreach ($push['rows'] as $item) { echo $item['ad_campaign_id'] . ','; } get only numbers values
$string = 'string'; $number = 4; // Cast to number $number = (int) $string; echo $number; // 0 // Another way to get only numbers $number = filter_var($string, FILTER_SANITIZE_NUMBER_INT); echo $number; // 0 // Truncate to zero $number = (int) $string; echo $number; // 0 // Round to lower number $number = round($string, 0); echo $number; // 0 // Round to upper number $number = ceil($string); echo $number; // 1