How would I use PHP to got to a specific URL, and get a specific part of it to display? Like I want only this part: out of: http://jisho.org/words?jap=ganguro&eng=&dict=edict It also has to be able to get other words if I decide to search for a different word.
<?php header('Content-Type: text/html;charset=utf-8'); //the word to find... $word = 'ganguro'; preg_match('~<td class="kanji_column">(.+?)</tr>~s', file_get_contents('http://jisho.org/words?jap='.$word.'&eng=&dict=edict'), $a); //now you can add css/styles etc. to the output if need be echo strip_tags($a[1]); ?> PHP:
What about for: http://www.animelab.com/anime.manga/dictionary/?word=ganguro&type=romaji&search=Normal and http://tangorin.com/words/ganguro ?
Whats with that?, your question was not that. You said... ' Like I want only this part:'....'out of:' which is what I gave. This is not a 'Request your free php coding here' forum, its a help forum, follow what I posted and attempt it yourself, if you need help along the way reply.
What if there is mutiple results? Like if I searched: http://jisho.org/words?jap=sekai&eng=&dict=edict
<?php header('Content-Type: text/html;charset=utf-8'); //the word to find... $word = 'sekai'; preg_match_all('~<td class="kanji_column">(.+?)</tr>~s', file_get_contents('http://jisho.org/words?jap='.$word.'&eng=&dict=edict'), $a); foreach($a[1] as $result){ echo strip_tags($result)."<br>"; } ?> PHP:
<?php header('Content-Type: text/html;charset=utf-8'); //the word to find... $word = 'sekai'; preg_match_all('~<td class="kanji_column">(.+?)</tr>~s', file_get_contents('http://jisho.org/words?jap='.$word.'&eng=&dict=edict'), $a); foreach($a[1] as $result){ echo "<div class=\"output\">".strip_tags($result)."</div><br>"; } ?> <style type="text/css"> .output { color: blue; background-color: #d8da3d; } </style> PHP: Custimize the css, a basic knowledge of css and html. Would help before jumping into php. http://www.w3schools.com/css/default.asp