我需要查看变量是否以键“ef”开头,如 ef1、efabc、efanythink...如果是,显示错误消息,我在这里混合了 php 和 jsp,当然不正确并且有错误,我不明白 jsp:
<c:if test="${empty channel.getChannelName()}">
<%
if (string_starts_with(${channelName}, 'ef')) { header("location:http://google.com"); }
Run Code Online (Sandbox Code Playgroud)
或显示此错误 div
<div class="error"> This Channel url Portected!</div>
Run Code Online (Sandbox Code Playgroud)
原始文件:http : //pastebin.com/ach8PXY9