Home > Backend Development > PHP Tutorial > 分割字符的有关问题

分割字符的有关问题

WBOY
Release: 2016-06-13 13:13:14
Original
922 people have browsed it

分割字符的问题?
想将字符串分为两部分,第一个字为第一部分,剩余为第二部分。

例如,英国旅游,分割成 英+国旅游
中国北京,分割成 中+国北京

求个简便方法

------解决方案--------------------
iconv_set_encoding("internal_encoding", "GBK");//是什么编码就填什么编码

$s = '英国旅游';
echo iconv_substr($s, 0, 1) . '+' . iconv_substr($s, 1);

Related labels:
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