Last active
August 18, 2020 13:27
-
-
Save amorkovin/b77cf085743bef49913e7081c4501ccd to your computer and use it in GitHub Desktop.
Убрать пробелы у всех элементов массива
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$get_cat_ids_not_parce = explode(',', $get_cat_ids_not_parce); | |
$get_cat_ids_not_parce = array_map('trim', $get_cat_ids_not_parce); | |
// Если значения должны быть только целами числами | |
foreach ($get_cat_ids_not_parce as $index => $value) { | |
$get_cat_ids_not_parce[$index] = (int)$value; | |
} | |
$get_cat_ids_not_parce = array_diff($get_cat_ids_not_parce, array(0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment