climbjm Posted August 23, 2006 Share Posted August 23, 2006 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 More sharing options...
448191 Posted August 23, 2006 Share Posted August 23, 2006 You have a misplaced bracket:[code] if (!in_array($temp_url,$urls_array)) array_push($urls_array, $temp_url);[/code] Link to comment https://forums.phpfreaks.com/topic/18388-resolved-in_array-issues/#findComment-79048 Share on other sites More sharing options...
climbjm Posted August 23, 2006 Author Share Posted August 23, 2006 Ah man, thanks.... I it's always the stupid stuff Link to comment https://forums.phpfreaks.com/topic/18388-resolved-in_array-issues/#findComment-79051 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.