case - 保持大小写不变的问题
问题描述
我使用以下 php 来显示 URL 的任何部分:
<?php
$segments = explode('/', trim(parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH), '/'));
$numSegments = count($segments);
$currentSegment1 = $segments[$numSegments - 1];
$currentSegment2 = $segments[$numSegments - 2];
$currentSegment3 = $segments[$numSegments - 3];
$currentSegment4 = $segments[$numSegments - 4];
?>
<?php echo $currentSegment1;?>
问题是它全部转换为小写: http ://example.com/ABCDefgh
它显示 abcdefgh 而不是 ABCDefgh,这是一个问题,因为我使用它来嵌入视频 ID 区分大小写的 youtube 视频。
我的问题:脚本有什么办法可以保持大小写不变?
谢谢!
解决方案
推荐阅读
- python - Heroku 上的“ModuleNotFoundError: No module named 'flask'”
- python - Scipy 最小化和步长约束
- google-sheets - 有没有办法用 zapier 复制谷歌表格并保留共享权限?
- c - 下一个布局显示 [ 无可用来源 ]
- python - 获取在 Django 中找到搜索值的列名
- java - 使用 Intellij 时 ID 为“junit-vintage”的错误 TestEngine 无法发现测试
- algorithm - 使用 Pyspark 实现页面排名算法
- python - 如何在 Robotframework+Selenium Headless 中录制并发测试执行的视频
- php - 如何实现允许空关系的动态关系?
- typescript - 在归纳案例中进行控制流分析