mraza Posted July 24, 2010 Share Posted July 24, 2010 Hi i wants to extract a link from a script line i wants to get this line img.src = 'http:\/\/this link i wants to extract'; from below code, please can someone tell me how can i do that. <script> var yt = yt || {}; t.preload = {}; y.preload.start = function() { var img = new Image(); t.preload.videoConnection = img; img.onload = img.onerror = function () { delete t.preload.videoConnection; }; img.src = 'http:\/\/this link i wants to extract it alos contain $%&= type of words'; img = null; }; yt.preload.start(); </script> Thanks for support Link to comment https://forums.phpfreaks.com/topic/208773-extract-url-from-script-help/ Share on other sites More sharing options...
CagedApe Posted July 24, 2010 Share Posted July 24, 2010 This should probably be in Javascript help... Link to comment https://forums.phpfreaks.com/topic/208773-extract-url-from-script-help/#findComment-1090665 Share on other sites More sharing options...
mraza Posted July 24, 2010 Author Share Posted July 24, 2010 sorry it was php related question, nvm i figured it out here solution preg_match("/(?s)img\.src = '(.*?)';/", $html, $m1); Thanks Link to comment https://forums.phpfreaks.com/topic/208773-extract-url-from-script-help/#findComment-1090686 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.