I have a very basic question about PHP, I could not solve it with other answers in stackoverflow.
I have an array like :
[0] => this one i need 1
[1] => this one i need 2
[2] => not need this one
so, I want to check for every one, if it contains 'this one i need', then put that into another array
So we must have this array at least :
[0] => this one i need 1
[1] => this one i need 2
I tried to do it like this but it returned Empty array :
foreach($one as $value) {
if(in_array("my name",$value)) $ok[] = $value;
}
$valueshould be array since you are using it as an array parameter inin_array()function, but based onforeach(), it should not be an array. So which is it?