I have below array:
[0] => href="/favicon.ico"
[1] => href="/w/opensearch_desc.php"
[2] => href="http://www.xxxxx.org/w/api.php?action=rsd"
[3] => href="http://www.gnu.org/copyleft/fdl.html"
[4] => href="/w/index.php?title=Special:RecentChanges&feed=atom"
[5] => href="/w/skins/common/commonPrint.css"
[6] => href="#navigation"
[7] => href="#p-wikisearch"
[8] => href="/wiki/Bookshelf_How-To"
[9] => href="/wiki/Category:DE_B%C3%BCcherregal"
[10] => href="/wiki/Category:FR_Genre"
[11] => href="/wiki/Category:IT_Biblioteca"
[12] => href="/wiki/Category:PT_Prateleira"
[13] => href="/wiki/Category:Agriculture_Bookshelf"
[14] => href="/wiki/Category:Animal"
[15] => href="/wiki/Category:Children%27s_Bookshelf"
[16] => href="/wiki/Category:Classics_Bookshelf"
[17] => href="/wiki/Category:Countries_Bookshelf"
[18] => href="/wiki/Category:Crime_Bookshelf"
[19] => href="/wiki/Category:Education_Bookshelf"
[20] => href="/wiki/Category:Fine_arts_Bookshelf"
[21] => href="/wiki/Category:General_Works_Bookshelf"
[22] => href="/wiki/Category:Geography_Bookshelf"
[23] => href="/wiki/Category:Health_Bookshelf"
[24] => href="/wiki/Category:History_Bookshelf"
[25] => href="/wiki/Category:Language_and_Literature_Bookshelf"
[26] => href="/wiki/Category:Law_Bookshelf"
[27] => href="/wiki/Category:Library_Science"
[28] => href="/wiki/Category:Music_Bookshelf"
[29] => href="/wiki/Category:Periodicals_Bookshelf"
[30] => href="/wiki/Category:Political_Science_Bookshelf"
[31] => href="/wiki/Category:Psychology_and_Philosophy_Bookshelf"
[32] => href="/wiki/Category:Religion_Bookshelf"
[33] => href="/wiki/Category:Science_Bookshelf"
[34] => href="/wiki/Category:Social_Sciences_Bookshelf"
[35] => href="/wiki/Category:Technology_Bookshelf"
[36] => href="/wiki/Category:Wars_Bookshelf"
[37] => href="/w/index.php?title=Category:Bookshelf&pagefrom=The+Galaxy+%28Bookshelf%29#mw-pages"
[38] => href="/wiki/Adventure_(Bookshelf)"
[39] => href="/wiki/Africa_(Bookshelf)"
[40] => href="/wiki/African_American_Writers_(Bookshelf)"
Now, simply I want this array as a result:
[13] => Agriculture_Bookshelf
[14] => Animal
[15] => Children%27s_Bookshelf
[16] => Classics_Bookshelf
[17] => Countries_Bookshelf
[18] => Crime_Bookshelf
[19] => Education_Bookshelf
[20] => Fine_arts_Bookshelf
[21] => General_Works_Bookshelf
[22] => Geography_Bookshelf
[23] => Health_Bookshelf
[24] => History_Bookshelf
[25] => Language_and_Literature_Bookshelf
[26] => Law_Bookshelf
[27] => Library_Science
[28] => Music_Bookshelf
[29] => Periodicals_Bookshelf
[30] => Political_Science_Bookshelf
[31] => Psychology_and_Philosophy_Bookshelf
[32] => Religion_Bookshelf
[33] => Science_Bookshelf
[34] => Social_Sciences_Bookshelf
[35] => Technology_Bookshelf
[36] => Wars_Bookshelf
I am using this code for getting the above results but still no lucks.
$match[0]
contains the above array.
$str = '_Bookshelf';
if(in_array($str,$match[0])){
echo "FOUND!!";
foreach($match[0] as $asd=>$asds){
echo "<pre>";echo str_replace('href="/wiki/Category:','',$asds);echo "</pre>";
}
}
Please can anybody rectify my code for the desired results.