首页 > 解决方案 > 从 url 替换特定值

问题描述

我想用 URL 替换 '/50'。我的 URL 是

http://localhost/CI/admin/pcustomer/cprofile/50?customer=18267&mobile=&nearby=

我想要网址为

http://localhost/CI/admin/pcustomer/cprofile?customer=18267&mobile=&nearby=

标签: phpcodeigniter

解决方案


从您问题中的那一点信息来看,这似乎是实现“我想用 URL 替换 '/50' ”的最简单方法

$url = str_replace('/50', '', 'http://localhost/CI/admin/pcustomer/cprofile/50?customer=18267&mobile=&nearby=');

推荐阅读