how to take first two char of a strinf in php code example Example: get only the first two word from a string php $message = preg_split('/[\s,]+/', $message, 3)