- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$str = 'word
one of each
one fish two fish red fish blue fish
car : carpet as java : javascript!!&@$%^&
testing, 1, 2 testing
go Go GO Stop stop
hello\nworld
hello\tworld
hello world
\t\tIntroductory Course ';
preg_match_all("/\w+/", $str, $matches);
var_dump($matches);