首页 > 网站 > 建站经验 > 正文

php替换多个字符串str_replace函数

2024-04-25 20:30:27
字体:
来源:转载
供稿:网友

php替换多个字符串str_replace函数

echostr_replace(array("m","i"),array("n","z"),"my name is jim!")

echostr_replace(array('m','i'),'n',"my name is jim!");

<?php$vowels =array("a","e","i","o","u","A","E","I","O","U");      $onlyconsonants = str_replace($vowels,"","Hello World of PHP");      echo$onlyconsonants;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表