PHP Array to grab string I need a code to be done.. lets say i have a variable call $content, and its value is equal to the below. <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261579810/12e6e875/dlink__2Fdownload_2F261579810_2F12e6e875_3Ftsid_3D20100411-133409-3d47317f/preview.flv"/> Part 2 <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261580266/460b860a/dlink__2Fdownload_2F261580266_2F460b860a_3Ftsid_3D20100411-133434-e86cfc61/preview.flv"/> Code (markup): If you notice there is 2 link, i want to use array to grab the first link, then grab the second link. Start from url= till the "/> Then lets say now array[1] = http://dc230.4shared.com/img/261579...3Ftsid_3D20100411-133409-3d47317f/preview.flv and array[2] = http://dc230.4shared.com/img/261580...3Ftsid_3D20100411-133434-e86cfc61/preview.flv I want reproduce it out in echo as Array 1 - http://dc230.4shared.com/img/261579...3Ftsid_3D20100411-133409-3d47317f/preview.flv Array 2 - http://dc230.4shared.com/img/261580...3Ftsid_3D20100411-133434-e86cfc61/preview.flv The first guy with the coding solution to my p.m with working will get $10 usd, do send your paypal detail also for easy payment.
send you a pm, to use it do this <?php $content ='<embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261579810/12e6e875/dlink__2Fdownload_2F261579810_2F12e6e875_3Ftsid_3D20100411-133409-3d47317f/preview.flv"/> Part 2 <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261580266/460b860a/dlink__2Fdownload_2F261580266_2F460b860a_3Ftsid_3D20100411-133434-e86cfc61/preview.flv"/>'; preg_match_all('/url=(.*?flv)/sim', $content, $result, PREG_PATTERN_ORDER); $result = $result[0]; foreach( $result as $key => $url ) printf('<p>Array %d - %s</p>', (int)$key, $url ); ?> PHP:
everything working as it should? here's the revised code that's actually tested <?php $content ='<embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261579810/12e6e875/dlink__2Fdownload_2F261579810_2F12e6e875_3Ftsid_3D20100411-133409-3d47317f/preview.flv"/> Part 2 <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261580266/460b860a/dlink__2Fdownload_2F261580266_2F460b860a_3Ftsid_3D20100411-133434-e86cfc61/preview.flv"/><embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261579810/12e6e875/dlink__2Fdownload_2F261579810_2F12e6e875_3Ftsid_3D20100411-133409-3d47317f/preview.flv"/> Part 2 <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261580266/460b860a/dlink__2Fdownload_2F261580266_2F460b860a_3Ftsid_3D20100411-133434-e86cfc61/preview.flv"/><embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261579810/12e6e875/dlink__2Fdownload_2F261579810_2F12e6e875_3Ftsid_3D20100411-133409-3d47317f/preview.flv"/> Part 2 <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261580266/460b860a/dlink__2Fdownload_2F261580266_2F460b860a_3Ftsid_3D20100411-133434-e86cfc61/preview.flv"/><embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261579810/12e6e875/dlink__2Fdownload_2F261579810_2F12e6e875_3Ftsid_3D20100411-133409-3d47317f/preview.flv"/> Part 2 <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261580266/460b860a/dlink__2Fdownload_2F261580266_2F460b860a_3Ftsid_3D20100411-133434-e86cfc61/preview.flv"/><embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261579810/12e6e875/dlink__2Fdownload_2F261579810_2F12e6e875_3Ftsid_3D20100411-133409-3d47317f/preview.flv"/> Part 2 <embed src="http://i312.photobucket.com/albums/ll351/baokychen/player.swf" width="480" height="400" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="config=http://www.animeshippuuden.com/xml.php?url=http://dc230.4shared.com/img/261580266/460b860a/dlink__2Fdownload_2F261580266_2F460b860a_3Ftsid_3D20100411-133434-e86cfc61/preview.flv"/>'; preg_match_all('/url=(.*?flv)/sim', $content, $result, PREG_PATTERN_ORDER); $result = $result[1]; foreach( $result as $key => $url ) printf('<p>Array %d - %s</p>', ( (int)$key + 1 ), $url ); ?> PHP: