<?php if ( isset($_GET['show']) ){ $show = $_GET['show']; } else if ( isset($_GET['e']) ){ $e = $_GET['e']; } else { die('no input'); } $x = "http://myanimelist.net/anime/$show"; $i = file_get_contents($x); $id = "content"; $raw = preg_match('/<div id=\"".$id."\">(.*?)</div>/',$i,$match); echo $raw; ?> i'm trying to grab whats inside the sypnosis info, and the picture by using php is this correct, it doesnt seem to be working.
Better explaining what you are trying to do would probably be best. Using the CODE tags (at the top of the posting box) will also help.
Kinda hard to follow as cro91 said, have you echoed it out any of your booleans to see if they are returning anything? and not sure where $match comes into play either. You may need to post more of this script for a better view. -edit- just looking further on your code it appears that (and I'm assuming) a user can enter two types of input, $show and $e where $x = "http://myanimelist.net/anime/$show"; is not the case (false) there seems to be no alternative for $e ie: $y = "http://myanimelist.net/anime/$e"; which would require an if boolean statement to supplement. ROOFIS
i think you are trying to extract some text from another website, and you are finding it via regex.. can you post a sample data from what the file_get_contents are retrieving?
i figure this out already thanks you all though heres how it came to out http://www.animerocket.net/myanimelist.php?show=19/Monster