我有一个像这样的简单脚本
$data = "http://example.com/index.php?data=data&value=value";
Run Code Online (Sandbox Code Playgroud)
如何从$ data获取基本URL?输出将是这样的
http://example.com
Run Code Online (Sandbox Code Playgroud)
没有此文本的输出"/index.php?data=data&value=value
php ×1