<?php $s = '1-2=3-4=5';$parts = preg_split('/([-=])/', $s, null, PREG_SPLIT_DELIM_CAPTURE);var_dump($parts);
Standard input is empty
array(9) { [0]=> string(1) "1" [1]=> string(1) "-" [2]=> string(1) "2" [3]=> string(1) "=" [4]=> string(1) "3" [5]=> string(1) "-" [6]=> string(1) "4" [7]=> string(1) "=" [8]=> string(1) "5" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!