I am trying to compare post titles in wordpress to avoid creating a post with a title that already exists.
foreach ($postnamearray as $value)
{
if($value === $titelzor)
{
echo' '.$value.' === '.$titelzor.' ';
}
else
{
echo' '.$value.' != '.$titelzor.' <br /> ';
}
}
However, it's not working! When a match is supposed to be found, it comes back as (sorry for dutch text):
zovty, bedankt! != zovty, bedankt!
But it's supposed to come back as
zovty, bedankt! === zovty, bedankt!
So the script doesn't seem to detect it as having found a match. What did I do wrong?