Home >Backend Development >PHP Tutorial >strrchr intercepts spaces
As in the title:
<code>echo strrchr('123.jpg','.').'<br/>'; echo strrchr('123 jpg',' ').'<br/>'; </code>
Result:
.jpg
jpg
Why does the result contain no spaces when intercepting spaces? Is it taken by default?
As in the title:
<code>echo strrchr('123.jpg','.').'<br/>'; echo strrchr('123 jpg',' ').'<br/>'; </code>
Result:
.jpg
jpg
Why does the result contain no spaces when intercepting spaces? Is it taken by default?
The questioner, this pot strrchr
is not memorized, you are outputting it in the browser, and it was eaten by your browser. Please echo str_replace(' ',' ',strrchr('123 jpg',' ').'<br/>');
to view, or output the viewing results in the form of CLI
, the spaces are There is output.
var_dump(); is a good function.
var_dump(strrchr('123 jpg',' '));