3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $val="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam nibh. Nunc varius facilisis eros. Sed erat. In in velit quis arcu ornare laoreet. Curabitur adipiscing luctus massa. Integer ut purus ac augue commodo commodo. Nunc nec mi eu justo tempor consectetuer. Etiam vitae nisl. In dignissim lacus ut ante. Cras elit lectus, bibendum a, adipiscing vitae, commodo et, dui. Ut tincidunt tortor http://www.w3schools.com/php/php_ref_string.asp. Donec nonummy, enim in lacinia pulvinar, velit tellus scelerisque augue, ac posuere libero urna eget neque. Cras ipsum. Vestibulum pretium, lectus nec venenatis volutpat, purus lectus ultrices risus, a condimentum risus mi et quam. Pellentesque auctor http://www.w2schools.com/php/php_ref_string.aspfringilla neque. Duis eu massa ut lorem iaculis vestibulum. Maecenas facilisis elit sed justo. Quisque volutpat malesuada velit. "; $replace=str_replace(' ','&&',$val); echo $replace; $explode=explode('&&http',$replace); print_r($explode); for($i=0;$i<count($explode);$i++){ $explodenew=explode('//',$explode[$i]); print_r($explodenew); for($j=0;$j<count($explodenew);$j++){ $explodenew1=explode('.asp',$explode[$i]); print_r($explodenew1); } } ?>
based on E6Icq
Output for 4.3.0 - 7.2.0
Lorem&&ipsum&&dolor&&sit&&amet,&&consectetuer&&adipiscing&&elit.&&Nam&&nibh.&&Nunc&&varius&&facilisis&&eros.&&Sed&&erat.&&In&&in&&velit&&quis&&arcu&&ornare&&laoreet.&&Curabitur&&adipiscing&&luctus&&massa.&&Integer&&ut&&purus&&ac&&augue&&commodo&&commodo.&&Nunc&&nec&&mi&&eu&&justo&&tempor&&consectetuer.&&Etiam&&vitae&&nisl.&&In&&dignissim&&lacus&&ut&&ante.&&Cras&&elit&&lectus,&&bibendum&&a,&&adipiscing&&vitae,&&commodo&&et,&&dui.&&Ut&&tincidunt&&tortor&&http://www.w3schools.com/php/php_ref_string.asp.&&Donec&&nonummy,&&enim&&in&&lacinia&&pulvinar,&&velit&&tellus&&scelerisque&&augue,&&ac&&posuere&&libero&&urna&&eget&&neque.&&Cras&&ipsum.&&Vestibulum&&pretium,&&lectus&&nec&&venenatis&&volutpat,&&purus&&lectus&&ultrices&&risus,&&a&&condimentum&&risus&&mi&&et&&quam.&&Pellentesque&&auctor&&http://www.w2schools.com/php/php_ref_string.aspfringilla&&neque.&&Duis&&eu&&massa&&ut&&lorem&&iaculis&&vestibulum.&&Maecenas&&facilisis&&elit&&sed&&justo.&&Quisque&&volutpat&&malesuada&&velit.&&Array ( [0] => Lorem&&ipsum&&dolor&&sit&&amet,&&consectetuer&&adipiscing&&elit.&&Nam&&nibh.&&Nunc&&varius&&facilisis&&eros.&&Sed&&erat.&&In&&in&&velit&&quis&&arcu&&ornare&&laoreet.&&Curabitur&&adipiscing&&luctus&&massa.&&Integer&&ut&&purus&&ac&&augue&&commodo&&commodo.&&Nunc&&nec&&mi&&eu&&justo&&tempor&&consectetuer.&&Etiam&&vitae&&nisl.&&In&&dignissim&&lacus&&ut&&ante.&&Cras&&elit&&lectus,&&bibendum&&a,&&adipiscing&&vitae,&&commodo&&et,&&dui.&&Ut&&tincidunt&&tortor [1] => ://www.w3schools.com/php/php_ref_string.asp.&&Donec&&nonummy,&&enim&&in&&lacinia&&pulvinar,&&velit&&tellus&&scelerisque&&augue,&&ac&&posuere&&libero&&urna&&eget&&neque.&&Cras&&ipsum.&&Vestibulum&&pretium,&&lectus&&nec&&venenatis&&volutpat,&&purus&&lectus&&ultrices&&risus,&&a&&condimentum&&risus&&mi&&et&&quam.&&Pellentesque&&auctor [2] => ://www.w2schools.com/php/php_ref_string.aspfringilla&&neque.&&Duis&&eu&&massa&&ut&&lorem&&iaculis&&vestibulum.&&Maecenas&&facilisis&&elit&&sed&&justo.&&Quisque&&volutpat&&malesuada&&velit.&& ) Array ( [0] => Lorem&&ipsum&&dolor&&sit&&amet,&&consectetuer&&adipiscing&&elit.&&Nam&&nibh.&&Nunc&&varius&&facilisis&&eros.&&Sed&&erat.&&In&&in&&velit&&quis&&arcu&&ornare&&laoreet.&&Curabitur&&adipiscing&&luctus&&massa.&&Integer&&ut&&purus&&ac&&augue&&commodo&&commodo.&&Nunc&&nec&&mi&&eu&&justo&&tempor&&consectetuer.&&Etiam&&vitae&&nisl.&&In&&dignissim&&lacus&&ut&&ante.&&Cras&&elit&&lectus,&&bibendum&&a,&&adipiscing&&vitae,&&commodo&&et,&&dui.&&Ut&&tincidunt&&tortor ) Array ( [0] => Lorem&&ipsum&&dolor&&sit&&amet,&&consectetuer&&adipiscing&&elit.&&Nam&&nibh.&&Nunc&&varius&&facilisis&&eros.&&Sed&&erat.&&In&&in&&velit&&quis&&arcu&&ornare&&laoreet.&&Curabitur&&adipiscing&&luctus&&massa.&&Integer&&ut&&purus&&ac&&augue&&commodo&&commodo.&&Nunc&&nec&&mi&&eu&&justo&&tempor&&consectetuer.&&Etiam&&vitae&&nisl.&&In&&dignissim&&lacus&&ut&&ante.&&Cras&&elit&&lectus,&&bibendum&&a,&&adipiscing&&vitae,&&commodo&&et,&&dui.&&Ut&&tincidunt&&tortor ) Array ( [0] => : [1] => www.w3schools.com/php/php_ref_string.asp.&&Donec&&nonummy,&&enim&&in&&lacinia&&pulvinar,&&velit&&tellus&&scelerisque&&augue,&&ac&&posuere&&libero&&urna&&eget&&neque.&&Cras&&ipsum.&&Vestibulum&&pretium,&&lectus&&nec&&venenatis&&volutpat,&&purus&&lectus&&ultrices&&risus,&&a&&condimentum&&risus&&mi&&et&&quam.&&Pellentesque&&auctor ) Array ( [0] => ://www.w3schools.com/php/php_ref_string [1] => .&&Donec&&nonummy,&&enim&&in&&lacinia&&pulvinar,&&velit&&tellus&&scelerisque&&augue,&&ac&&posuere&&libero&&urna&&eget&&neque.&&Cras&&ipsum.&&Vestibulum&&pretium,&&lectus&&nec&&venenatis&&volutpat,&&purus&&lectus&&ultrices&&risus,&&a&&condimentum&&risus&&mi&&et&&quam.&&Pellentesque&&auctor ) Array ( [0] => ://www.w3schools.com/php/php_ref_string [1] => .&&Donec&&nonummy,&&enim&&in&&lacinia&&pulvinar,&&velit&&tellus&&scelerisque&&augue,&&ac&&posuere&&libero&&urna&&eget&&neque.&&Cras&&ipsum.&&Vestibulum&&pretium,&&lectus&&nec&&venenatis&&volutpat,&&purus&&lectus&&ultrices&&risus,&&a&&condimentum&&risus&&mi&&et&&quam.&&Pellentesque&&auctor ) Array ( [0] => : [1] => www.w2schools.com/php/php_ref_string.aspfringilla&&neque.&&Duis&&eu&&massa&&ut&&lorem&&iaculis&&vestibulum.&&Maecenas&&facilisis&&elit&&sed&&justo.&&Quisque&&volutpat&&malesuada&&velit.&& ) Array ( [0] => ://www.w2schools.com/php/php_ref_string [1] => fringilla&&neque.&&Duis&&eu&&massa&&ut&&lorem&&iaculis&&vestibulum.&&Maecenas&&facilisis&&elit&&sed&&justo.&&Quisque&&volutpat&&malesuada&&velit.&& ) Array ( [0] => ://www.w2schools.com/php/php_ref_string [1] => fringilla&&neque.&&Duis&&eu&&massa&&ut&&lorem&&iaculis&&vestibulum.&&Maecenas&&facilisis&&elit&&sed&&justo.&&Quisque&&volutpat&&malesuada&&velit.&& )