Hi,
I'm wondering if it possible to simplify the following code by giving FOREACH an ability to handle conditions by itself without having to use a sub IF statement as seen below :
Thanks
I'm wondering if it possible to simplify the following code by giving FOREACH an ability to handle conditions by itself without having to use a sub IF statement as seen below :
Code:
foreach ($array as $key => $value) {
if (strstr($value, "something")) {
do_something();
}
}
Thanks