dingus Posted March 14, 2008 Share Posted March 14, 2008 hey i'm working with adbrite invideo today trying to design a easy to use script to work with there interface but i'm hitting walls left right and center i managed to get the reply from the server with curl now i have something that looks like this <addvideo> <type>success</type> <message><![CDATA[<script src="http://files.adbrite.com/player/js/abplayerlib.js" language="javascript"></script> <script language="javascript"> abWritePlayer(1674937, 468, 400, "http://vid.adbrite.com/video/abplayer?"); </script> <noscript> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="468" height="400" id="abPlayerObj" align="middle"><param name="movie" value="http://vid.adbrite.com/video/abplayer.swf?&vid=1674937&og=1" /><param name="quality" value="best" /><embed src="http://vid.adbrite.com/video/abplayer.swf?&vid=1674937&og=1" quality="best" width="468" height="400" name="abPlayerObj" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object> </noscript>]]></message> <message>1674937</message> </addvideo> i need to extract the TYPE and the first message in to 2 different variables but once again its got me comply stuck can anyone offer some insight Link to comment https://forums.phpfreaks.com/topic/96077-adbrite-invideo/ Share on other sites More sharing options...
lordfrikk Posted March 14, 2008 Share Posted March 14, 2008 This worked for me: <?php preg_match('/\<type>(.+)\<\/type>/', $variable, $match); echo $match[1]; preg_match('/\<message>(.+?)\<\/message>/', str_replace("\n", "", $variable), $match2); echo $match2[1]; ?> Link to comment https://forums.phpfreaks.com/topic/96077-adbrite-invideo/#findComment-492031 Share on other sites More sharing options...
dingus Posted March 14, 2008 Author Share Posted March 14, 2008 hey thanks for that really helpful Link to comment https://forums.phpfreaks.com/topic/96077-adbrite-invideo/#findComment-492059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.