Get the App
SLTechnology News&Howtos  ›  Development  › 

How does php tell if the last word is an area and delete it?

Shulou Source: shulou.com Published: 2022-06-01 04:49:48 10月02日 Update

This article mainly introduces php how to judge that the last word is deleted on the area, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.

If the last word is "zone", delete it.

$distName = 'Nanshan District'; $lastChar= mb_substr ($distName,-1); if ($lastChar==' District') {$lastChar= mb_substr ($distName, 0,-1);} echo $lastChar Thank you for reading this article carefully. I hope the article "how to judge that the last word is deleted by php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Articles value interest Nanshan at the same time more friends knowledge editing industry information information channels channels Nanshan District reference learning help support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology Linux MySQL OPPO Reno