strrchr intercepts spaces

WBOY
Release: 2023-03-01 20:08:01
Original
1278 people have browsed it

As in the title:

<code>echo strrchr('123.jpg','.').'<br/>';
echo strrchr('123 jpg',' ').'<br/>';
</code>
Copy after login
Copy after login

Result:
.jpg
jpg
Why does the result contain no spaces when intercepting spaces? Is it taken by default?

Reply content:

As in the title:

<code>echo strrchr('123.jpg','.').'<br/>';
echo strrchr('123 jpg',' ').'<br/>';
</code>
Copy after login
Copy after login

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(' ','&nbsp',strrchr('123 jpg',' ').'<br/>'); to view, or output the viewing results in the form of CLI, the spaces are There is output.
strrchr intercepts spaces
strrchr intercepts spaces

var_dump(); is a good function.

var_dump(strrchr('123 jpg',' '));

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!