我确信必须有一种简单的方法从字符串末尾获取第n个字符。 p>
例如: p>
$ NthChar = get_nth('Hello',3); //将导致$ NthChar ='e'
code> pre>
div>
I'm sure there must be an easy way to get nth character from the end of string.
For example:
$NthChar = get_nth('Hello', 3); // will result in $NthChar='e'
我确信必须有一种简单的方法从字符串末尾获取第n个字符。 p>
例如: p>
$ NthChar = get_nth('Hello',3); //将导致$ NthChar ='e'
code> pre>
div>
Just do this
$rest = substr("abcdef", -3, 1); // returns 'd'
报告相同问题?