Hi all
I have an array structure as such:
Array
(
[1] => Array
(
[1] => 1
[2] => 2
[3] => 3
[4] => 4
[5] => 5
[6] => 6
[8] => 8flight
)
)
I loop through that array and assign the values to a session array as such:
if (!empty($chosenextras)) {
foreach($chosenextras as $key => $value) {
$_SESSION['S_CHOSEN_EXTRA'][$key] = $value;
}
}
Now, what I need is to search the values of the array and detect if the word 'flight' is there for any elementsa (as it will be optional).
If the word 'flight' is detected, I need to remove it completely and leave only the number which would leave me with the following array:
Array
(
[1] => Array
(
[1] => 1
[2] => 2
[3] => 3
[4] => 4
[5] => 5
[6] => 6
[8] => 8
)
)
Please note, the word 'flight' could be in any element of the array, not just KEY[8]
Any help would be greatly appreciated.
kbc1