Home  >  Article  >  Backend Development  >  如何才能漂亮的写一个转换字符的程序

如何才能漂亮的写一个转换字符的程序

WBOY
WBOYOriginal
2016-06-13 13:42:26889browse

怎么才能漂亮的写一个转换字符的程序
遗传字符
如果含有是“买” 转换成 则转换成“卖”

如果含有是“卖”转换成“买”

如果是“男”转换成“女”
如果是“女”则转换成“男”


用if判断两次感觉好麻烦 有没的更优美的解决方法。

------解决方案--------------------
看清楚了!
是 strtr
不是 strstr

Statement:
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