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
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
$key = array_search('green', $array); // $key = 2;
$key = array_search('red', $array); // $key = 1;
?>
$array = [
'clothes' => 't-shirt',
'size' => 'medium',
'color' => 'blue',
];
extract($array);
echo("$clothes $size $color"); // t-shirt medium blue
Also in PHP:
- create folder if not exist php
- date format in day name of month and year in php
- PHP dynamic property name
- fetch ip address in php
- count elements of a string php
- create symfony project
- PHP try catch all exceptions
- Allowed memory size of 1610612736 bytes exhausted for laravel
- Dynamic title on every page laravel blade
- date('d/m/Y H:i:s') now
- clear cahce config laravel in cpanel
- addition in php
- display all errors php
- PHP Html-Optimizer on github
- doubles tennis random function php
- count length string php
- base64_decode online php
- best data structure in php for a unique values
- eloquent get only some columns
- create a seed laravel
- cancel stripe subscription php
- display error
- change native password in phpmyadmin
- PHP Warning: require(/Applications/Ampps/www/SalesSystem/vendor/composer/../symfony/polyfill-php80/bootstrap.php): failed to open stream: No such file or directory in /Applications/Ampps/www/SalesSystem/vendor/composer/autoload_real.php on line 66