<?php
$c = array();
// You store some data using some string keys
foreach (array('ab', 'cd', '10', 'gh', '24') as $key) {
$c[$key] = 1;
}
var_dump($c);
// You pass the array $c to some place else and there you do something like
foreach ($c as $k => $v) {
if ($k === '10') {
echo "found";
exit;
}
}
echo "Not found";
array(5) {
["ab"]=>
int(1)
["cd"]=>
int(1)
[10]=>
int(1)
["gh"]=>
int(1)
[24]=>
int(1)
}
Not found
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
array(5) {
["ab"]=>
int(1)
["cd"]=>
int(1)
[10]=>
int(1)
["gh"]=>
int(1)
[24]=>
int(1)
}
Not found