and assuming they're not always digits but a colon is always the separator, a combination of split, array slicing, and join:
$result = join( ':', (split( /:/, $string))[0..2]);
update: I like hdb's better ... less parens.
In reply to Re^2: Using the Substr
by derby
in thread Using the Substr
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |