0p3n_p0rT Posted March 4, 2006 Share Posted March 4, 2006 Hey, I have something along the lines of this:<?$string = " <html> <title>sitename</title> <FRAMESET ROWS="*,0" COLS="100%" border="0"> <FRAME SRC="do.php?d=XQE2VILT&l=en" noresize> <FRAME SRC="s.php" noresize scrolling="no"> </FRAMESET> </html>";?>And I want to extract just the "do.php?d=XQE2VILT&l=en" part. However, the querystring is random, and the length of this this may differ. I have tried various substr, strchr, etc. etc. and cannot extract that certain bit.Can anybody help?Thanks,0p3n_p0rt. Quote Link to comment https://forums.phpfreaks.com/topic/4088-solved-strings/ Share on other sites More sharing options...
Hooker Posted March 4, 2006 Share Posted March 4, 2006 do you want all of do.php?d=XQE2VILT&l=en" or the "XQE2VILT" and "en" bits? Quote Link to comment https://forums.phpfreaks.com/topic/4088-solved-strings/#findComment-14206 Share on other sites More sharing options...
Barand Posted March 4, 2006 Share Posted March 4, 2006 Assuming you always have "do.php",[code]$p1 = strpos($string,'do.php');$p2 = strpos ($string, '"', $p1);$result = substr ($string, $p1, $p2-$p1);echo $result;[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4088-solved-strings/#findComment-14259 Share on other sites More sharing options...
0p3n_p0rT Posted March 4, 2006 Author Share Posted March 4, 2006 Thanks, that was great! Quote Link to comment https://forums.phpfreaks.com/topic/4088-solved-strings/#findComment-14283 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.