<?php $todo = 'Eu irei amanhã à casa. E tu vens?'; preg_match_all('~\w+|[^\s\w]+~u', $todo, $partes ); print_r( $partes[0] );
Standard input is empty
Array ( [0] => Eu [1] => irei [2] => amanhã [3] => à [4] => casa [5] => . [6] => E [7] => tu [8] => vens [9] => ? )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!