php in array
$colors = array("red", "blue", "green");
if (in_array("red", $colors)) {
echo "found red in array";
}
php in array
$colors = array("red", "blue", "green");
if (in_array("red", $colors)) {
echo "found red in array";
}
find element in arrat php
$userdb=Array
(
(0) => Array
(
(uid) => '100',
(name) => 'Sandra Shush',
(url) => 'urlof100'
),
(1) => Array
(
(uid) => '5465',
(name) => 'Stefanie Mcmohn',
(pic_square) => 'urlof100'
),
(2) => Array
(
(uid) => '40489',
(name) => 'Michael',
(pic_square) => 'urlof40489'
)
);
simply u can use this
$key = array_search(40489, array_column($userdb, 'uid'));
php value in array
in_array ( mixed $needle , array $haystack , bool $strict = false ) : bool
php return array
<?php
function data() {
$out[0] = "abc";
$out[1] = "def";
$out[2] = "ghi";
return $out;
}
$data = data();
foreach($data as $items){
echo $items;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us