“in_array asosiatif array php” Kode Jawaban

in_array asosiatif array php

$arr = array('lang1' => 'php','lang2' => 'java','lang3' => 'python');

if ( in_array( 'java', $arr ) ) {

  echo 'exists';

}else{

  echo 'not exists';

}
Black Bat

PHP Associative Array

<?php
$arr = array('fruit' => 'mango', 'vegetable' => 'tomato', 'thing' => 'bag');
echo $arr['fruit'];
/*OUTPUT
mango*/
?>
Tense Termite

PHP Associative Array

Array
(
    [Ahmed] => Rofy
    [Abdallah] => Oda
    [Michel] => Mic
    [Yahia] => ENG
)
Better Bear

PHP Associative Array

<?php
$arr = array('fruit' => 'mango', 'vegetable' => 'tomato', 'thing' => 'bag');
echo $arr[1]
//OUTPUT
//mango
?>
Tense Termite

Jawaban yang mirip dengan “in_array asosiatif array php”

Pertanyaan yang mirip dengan “in_array asosiatif array php”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya