To check if a value exists within a PHP array:
1.
if
(in_array(
"x"
,
$php_array
)) {
2.
// Exists
3.
}
To check if a value exists within a Python list:
1.
if
"x"
in
python_list:
2.
# Exists
Mainly notes to future-Twig (and for anyone else who may find them useful)
If you've found one or more of my blog posts helpful, why not say thanks by buying me a coffee or beer?
To check if a value exists within a PHP array:
1.
if
(in_array(
"x"
,
$php_array
)) {
2.
// Exists
3.
}
To check if a value exists within a Python list:
1.
if
"x"
in
python_list:
2.
# Exists