Getting first 3 letters of a string in php

Substring function in php:

$myword=”Hai how are you?”;

$result = substr($myword, 0, 3);

echo $result ;

Result will be “Hai”;