2levelsabove Posted June 3, 2009 Share Posted June 3, 2009 I keep getting an error The second argument, 'isoutgoing', should be a valid callback I know how callbacks work in procedural but how do I call it in OOP please help function get_outgoing_links($uri){ $uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri)); $uri = trim(eregi_replace('www.', '', $uri)); $this->url=$uri; $alllinks=explode(" ",$this->get_all_links($uri)); $outgoinglinksarray=array_filter($alllinks,"isoutgoing"); return $outgoinglinksarray; } //the call back function function isoutgoing($link) { $link1 = parse_url($link); $cleanlink1=$link1['host']; $$cleanlink1 = trim(eregi_replace('http://', '', $cleanlink1)); $cleanlink1 = trim(eregi_replace('http', '', $cleanlink1)); $cleanlink1 = trim(eregi_replace('www.', '', $cleanlink1)); if ( !strpos($link1['host'], $this->$url)) { return 1; } } Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 3, 2009 Share Posted June 3, 2009 $outgoinglinksarray=array_filter($alllinks,array($this, "isoutgoing")); You mean like that? Quote Link to comment Share on other sites More sharing options...
2levelsabove Posted June 3, 2009 Author Share Posted June 3, 2009 <b>Fatal error</b>: Using $this when not in object context on line <b>396</b><br /> Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted June 3, 2009 Share Posted June 3, 2009 Post all of your code and identify which is line 396. Quote Link to comment Share on other sites More sharing options...
2levelsabove Posted June 3, 2009 Author Share Posted June 3, 2009 $outgoinglinksarray=array_filter($alllinks,array($this, "isoutgoing")); ill post all code in just a few Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.