How to get first 5 characters from string [duplicate]

How to get first 5 characters from string using php

$myStr = "HelloWordl";

result should be like this

$result = "Hello";

5 Answers
5

Leave a Comment