This is the $feed_content array
Array
(
[0] => Array
(
[id] => 1
[link] => http://www.dust-off.com/10-tips-on-how-to-love-your-portable-screens-keeping-them-healthy
)
[1] => Array
(
[id] => 2
[link] => http://www.dust-off.com/are-you-the-resident-germaphobe-in-your-office
)
)
----Another array----------
This is the $arrFeeds array
Array
(
[0] => Array
(
[title] => 10 Tips on How to Love Your Portable Screens (Keeping them Healthy)
[link] => http://www.dust-off.com/10-tips-on-how-to-love-your-portable-screens-keeping-them-healthy
)
[1] => Array
(
[title] => Are You the Resident Germaphobe in Your Office?
[link] => http://www.dust-off.com/are-you-the-resident-germaphobe-in-your-office
)
)
Here's my code:
foreach( $arrFeeds as $key2 => $value2 )
{
$feed_content = $feed->get_feed_content( $value['id'] );
if( !in_array( $value2['link'], $feed_content ) )
{
echo "not match!";
}
}
Question:
Why is it that the code always enters into the if statement even if $feed_content link value has the value of the $arrFeeds link?
My expected result should be that my code would tell me if the $feed_content link value is not in the $arrFeeds.
By the way, the $feed_content
code returns an array that I specified above.
What should be the problem with this one. Thanks in advance! :)
in_array
on that one (or use the recursive mode). – hakre Mar 14 '12 at 15:36