vangilsweb Posted January 27, 2011 Share Posted January 27, 2011 I have the following variable: $text = "javascript:openimage('http://images.icecat.biz/img/norm/high/5966342-254.jpg',850,850)" Now I want to put the string "http://images.icecat.biz/img/norm/high/5966342-254.jpg" into a variable called $url ( $url = "http://images.icecat.biz/img/norm/high/5966342-254.jpg" ) How do I do this? Link to comment https://forums.phpfreaks.com/topic/225832-find-string-in-text/ Share on other sites More sharing options...
PaulRyan Posted January 27, 2011 Share Posted January 27, 2011 <?PHP $text = "javascript:openimage('http://images.icecat.biz/img/norm/high/5966342-254.jpg',850,850)"; $url = explode('\'',$text); $url = $url[1]; ?> Try the above and tell me how it goes Regards, PaulRyan. Link to comment https://forums.phpfreaks.com/topic/225832-find-string-in-text/#findComment-1165913 Share on other sites More sharing options...
vangilsweb Posted January 27, 2011 Author Share Posted January 27, 2011 YES this works! Thank you very much! Link to comment https://forums.phpfreaks.com/topic/225832-find-string-in-text/#findComment-1165923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.