Answers for "use is array in array php"

PHP
17

in_array php

<?php
$os = array("Apple", "Banana", "Lemon");
if (in_array("Apple", $os)) {
    echo "Yeah. Exist Apple";
}
if (!in_array("Buleberry", $os)) {
    echo "Oh, Don't Exist Blueberry!!!";
}
?>
Posted by: Guest on October-02-2020
1

in arrray php

$arr = array('php','java','python');

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

  echo 'available';

}else{

  echo 'not available';

}
Posted by: Guest on October-09-2021

Browse Popular Code Answers by Language