- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$matches = array();
preg_match_all('/(:\w+)/', 'jhkjh :fgfg :fgfg : : ffgg', $matches);
print_r($matches);
$matches = array();
preg_match_all('/(:\w+)/', 'jhkjh :fgfgfgfg :fgfg : : ffgg', $matches, PREG_SET_ORDER);
print_r($matches);