<?php $text = "red 1 green 3 blue";print_r(preg_split('~red|green|blue~', $text));print_r(preg_split('~red|green|blue~', $text, -1, PREG_SPLIT_NO_EMPTY));
Standard input is empty
Array ( [0] => [1] => 1 [2] => 3 [3] => ) Array ( [0] => 1 [1] => 3 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!