且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取PHP中URL的最后一个参数

更新时间:2023-02-23 22:20:03

像这样吗?

echo end(explode("/", $url));

如果启用了严格的错误报告,则将引发错误. 为了避免这种情况,请像这样将它们分开:

This will throw an error if strict error reporting is enabled. To avoid this, split them up like this:

$parts = explode("/", $url);
echo end($parts);