<?php $re = '~(?<=\G.{2})~'; $str = "splitstring"; $result = preg_split($re, $str);print_r($result);
Standard input is empty
Array ( [0] => sp [1] => lit [2] => str [3] => ing [4] => )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!