php - Using Parse_Url to strip url and rebuild within a foreach loop -


i want strip host , path elements "url" in array using foreach loop.

i doing comparing results different search engines , few "matching" due slight difference how search engines handle sites url's.

i have read php manual site, tried googling , read many of questions asked on stackoverflow can not find example dealing stripping elements within array within foreach loop , rebuilding them.

i hoping use this:

{$url0 =  parse_url($url, php_url_host); $url1 =  parse_url($url, php_url_path); $url = "$url0$url1";}  // foreach loop   foreach ($jsonobj->d->results $value) {    $resultsb[] = array(      'url' => strip_tags($value->url),      'url' => $value->url,      'title' => $value->title,      'rank' => $i--,      'desc' => $value->description,      $b++,   ); } 

any on or other method increase accuracy of matching process appreciated.

 foreach ($jsonobj->d->results $value) {      // leave host + path     $url = strip_tags($value->url);     $url = $url['host'] . $url['path'];      $resultsb[] = array(         'url' => $url,         'title' => $value->title,         'rank' => $i--,         'desc' => $value->description,         $b++,   ); } 

something this?


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -