JamesThePanda Posted April 16, 2011 Share Posted April 16, 2011 Hi Im having a problem finding the posistion of a div tag I tried this piece of code $fpos= strpos($snip, "<div id=\"footer\">") Then this piece $fpos= strpos($snip, "<div id="footer">") The $snip is the entire html document I thought maybe the \ might be causeing problem but without it Then i tried this any suggestions guys Thanks James Quote Link to comment https://forums.phpfreaks.com/topic/233904-strpos/ Share on other sites More sharing options...
cunoodle2 Posted April 16, 2011 Share Posted April 16, 2011 Are you 100% for sure that "$snip" has the correct values in it? Try echoing $snip to the screen and see what you get. Also try a find of just "$fpos= strpos($snip, "<div id="); and see what you get. Finally can you echo $fpos to the screen AFTER you do the search and see what it actually says? Echo to the screen is one of the best way to debug something. Quote Link to comment https://forums.phpfreaks.com/topic/233904-strpos/#findComment-1202376 Share on other sites More sharing options...
JamesThePanda Posted April 16, 2011 Author Share Posted April 16, 2011 snip echo out fine in regards to finding just "<div id=" there several div tages in the code would it end up giving the position off all of them. thanks James Quote Link to comment https://forums.phpfreaks.com/topic/233904-strpos/#findComment-1202380 Share on other sites More sharing options...
cunoodle2 Posted April 16, 2011 Share Posted April 16, 2011 Can you post your code? There has to be something else going on. Quote Link to comment https://forums.phpfreaks.com/topic/233904-strpos/#findComment-1202387 Share on other sites More sharing options...
JamesThePanda Posted April 16, 2011 Author Share Posted April 16, 2011 Hi Cunoodle For some reason its starte working now I been playing wit it for a hour or so. I think the problem was i was getting the data from a file and looking for several tags all at once. I just split them up a bit and thats seems to work Thanks SO much for you help James Quote Link to comment https://forums.phpfreaks.com/topic/233904-strpos/#findComment-1202411 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.