Jump to content

[resolved] in_array() issues


climbjm

Recommended Posts

Does anyone see why this is not working?

I have an array of URLS.
I am also pulling urls froma database and merging them into the array, but I dont want duplicates.

This is the code I am using...
[code]
while($row = mysql_fetch_array($result))
{
  $temp_url = "".$row['url'];
  echo($temp_url);
  // this checks to make sure that the URL isn't already in the Array
  if (!in_array($temp_url),$urls_array)
      array_push($urls_array, $temp_url);
}
[/code]

but I am getting this error:
[color=navy]Parse error: syntax error, unexpected ',' in /<mypath> /index.php on line <#>[/color]
Link to comment
https://forums.phpfreaks.com/topic/18388-resolved-in_array-issues/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.