3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = "This is a test string."; $length = preg_match_all('/[^ ]/' , $value, $matches); echo $length; echo "\n"; //example to filter (space) and the character i $length = preg_match_all('/[^ i]/' , $value, $matches); echo $length;

preferences:
164.52 ms | 404 KiB | 5 Q