foreach ($kridName as $key => $val){ }
<?php
$array = [
'one' => [
'one_subOne','one_subTwo','one_subThree'
],
'two' => [
'two_subOne','two_subTwo','two_subThree'
],
'three' => [
'three_subOne','three_subTwo','three_subThree'
],
'four' => [
'four_subOne','four_subTwo','four_subThree'
],
];
//Вариант 1 - но тогда внутренний указатель массива будет установлен на
//последний элемент
print_r(end($array));
//Вариант 2
print_r(array_slice($array,-1));
//Вариант 3 - но тогда последний элемент будет удален из массива $array
print_r(array_pop($array));
<input type="checkbox" class="svois" value="7"><label> Высота</label>
<input type="checkbox" class="svois" value="8"><label> Количество</label>
<input type="checkbox" class="svois" value="9"><label> Назначение</label>
<input type="checkbox" class="svois" value="10"><label> Способ изготовления, метод производства</label>
<input type="checkbox" class="svois" value="11"><label> Диаметр</label>
<input type="checkbox" class="svois" value="12"><label> Вид обработки</label>
<input type="checkbox" class="svois" value="13"><label> Тип покрытия</label>
<input type="checkbox" class="svois" value="14"><label> Форма</label>
<script>
var tagsArray = [];
$(".svois:checked").each(function(index) {
tagsArray.push($(this).val());
});
$.ajax({
type: "POST",
url: "ajax1.php",
data: {"svois": tagsArray},
success: function(onecat5){
$('#onecat5').html(onecat5);
}
});
</script>
$categoryID = $foreas[ "ITEM" ][ "CATEGORY_ID" ] ;
FIELDTRANS OBJECT (
[TITLE] => ТРАНСПОРТ
[IS_PUBLIC] => 1
[SQL] => INT(11) NULL DEFAULT NULL
[NAME] => TRANS
[ELEMENT_NAME] => TRANS
[FILTER_TYPE] =>
[FILTER_HINT] =>
[ELEMENT_TITLE] => ТРАНСПОРТ
[ALLOW_INDEX] => 1
[ITEM] => ARRAY (
[PHONE] =>
[CATEGORY_ID] => 2
[CTYPE_NAME] => BOARD
[CTYPE_ID] => 9
)
[IS_VIRTUAL] =>
[IS_HIDDEN] =>
[RULES] => ARRAY (
)
[OPTIONS] => ARRAY (
[IS_REQUIRED] =>
[IS_DIGITS] =>
[IS_NUMBER] => 0
[IS_ALPHANUMERIC] =>
[IS_EMAIL] =>
[IS_UNIQUE] =>
[LABEL_POS] => LEFT
[LABEL_IN_LIST] => LEFT
[LABEL_IN_ITEM] => LEFT
[PROFILE_VALUE] =>
)
[DATA] => ARRAY (
)
[CLASS] =>
TRANS [ID] => TRANS
[CTYPE_ID] => 9
[HINT] =>
[ORDERING] => 14
[FIELDSET] =>
[TYPE] => TRANS
[IS_IN_LIST] => 1
[IS_IN_ITEM] => 1
[IS_IN_FILTER] =>
[IS_PRIVATE] =>
[IS_FIXED] =>
[IS_FIXED_TYPE] =>
[IS_SYSTEM] =>
[VALUES] => КАМАЗ ЛЕГКОВАЯ МАШИНА
[GROUPS_READ] => ARRAY (
[0] => 0
)
[GROUPS_EDIT] => ARRAY (
[0] => 0
)
[DEFAULT] => КАМАЗ ЛЕГКОВАЯ МАШИНА
[HANDLER_TITLE] => ТРАНСПОРТ
)
$foo = <<<'CODE'
for ($x=1; $x<=$koluslug; $x++ ){
$slugSql2 = mysql_fetch_assoc(mysql_query("SELECT * FROM `info3` WHERE id='$slyg[$x]'")); echo $slugSql2['name'];
}
CODE;
eval($foo);
data: $('#myForm').serialize()