Finding a character at a specific position of a string

前端 未结 5 1682
眼角桃花
眼角桃花 2021-01-05 14:28

Since I am still new to PHP, I am looking for a way to find out how to get a specific character from a string.

Example:

$word = \"master\";
$length =         


        
5条回答
  •  春和景丽
    2021-01-05 15:08

    You can simply use $myStr{$random} to obtain the nth character of the string.

提交回复
热议问题