gpt4 book ai didi

php - 在 PHP 中完全按字面意思获取字符串

转载 作者:行者123 更新时间:2023-12-02 05:35:47 25 4
gpt4 key购买 nike

我使用 Hive Logic Enkoder 生成了一个混淆的电子邮件.我想用 PHP 回显结果。

问题是它包含', ", \\\\\\, 都是其中搞乱了 PHP 读取字符串的方式。我怎样才能使 PHP 按字面意思理解 - 转义需要转义的字符,并取消转义不需要的字符?

所以我想:

echo '<script type="text/javascript">
//<![CDATA[
<!--
var x="function f(x){var i,o=\"\",ol=x.length,l=ol;while(x.charCodeAt(l/13)!" +
"=102){try{x+=x;l+=l;}catch(e){}}for(i=l-1;i>=0;i--){o+=x.charAt(i);}return " +
"o.substr(0,ol);}f(\")12,\\\",&.=1,p?3k`,gcheB8'Xfo!l720\\\\430\\\\120\\\\>X" +
"%E220\\\\230\\\\100\\\\530\\\\700\\\\RS,OT130\\\\630\\\\400\\\\230\\\\130\\" +
"\\530\\\\4[120\\\\700\\\\600\\\\010\\\\300\\\\520\\\\,a038t=68&>&2?120\\\\(" +
"*\\\"\\\\,v$>%!&+g030\\\\~$$2Wt\\\\I330\\\\400\\\\r\\\\JOGUImi3hu771\\\\tmt" +
"yq\\\"(f};o nruter};))++y(^)i(tAedoCrahc.x(edoCrahCmorf.gnirtS=+o;721=%y;i=" +
"+y)12==i(fi{)++i;l<i;0=i(rof;htgnel.x=l,\\\"\\\"=o,i rav{)y,x(f noitcnuf\")" ;
while(x=eval(x));
//-->
//]]>
</script>
';

编辑:这是我现在使用的函数:

function supportEmail() {
$str = <<<'EOT'
<script type="text/javascript">
//<![CDATA[
<!--
var x="function f(x){var i,o=\"\",ol=x.length,l=ol;while(x.charCodeAt(l/13)!" +
"=102){try{x+=x;l+=l;}catch(e){}}for(i=l-1;i>=0;i--){o+=x.charAt(i);}return " +
"o.substr(0,ol);}f(\")12,\\\",&.=1,p?3k`,gcheB8'Xfo!l720\\\\430\\\\120\\\\>X" +
"%E220\\\\230\\\\100\\\\530\\\\700\\\\RS,OT130\\\\630\\\\400\\\\230\\\\130\\" +
"\\530\\\\4[120\\\\700\\\\600\\\\010\\\\300\\\\520\\\\,a038t=68&>&2?120\\\\(" +
"*\\\"\\\\,v$>%!&+g030\\\\~$$2Wt\\\\I330\\\\400\\\\r\\\\JOGUImi3hu771\\\\tmt" +
"yq\\\"(f};o nruter};))++y(^)i(tAedoCrahc.x(edoCrahCmorf.gnirtS=+o;721=%y;i=" +
"+y)12==i(fi{)++i;l<i;0=i(rof;htgnel.x=l,\\\"\\\"=o,i rav{)y,x(f noitcnuf\")" ;
while(x=eval(x));
//-->
//]]>
</script>
EOT;
echo $str;
}

但是我收到了这个错误:

解析错误:语法错误,意外的 $end,需要 T_VARIABLE 或 T_END_HEREDOC 或 T_DOLLAR_OPEN_CURLY_BRACES 或 T_CURLY_OPEN

最佳答案

echo <<<'EOT'
<script type="text/javascript">
//<![CDATA[
<!--
var x="function f(x){var i,o=\"\",ol=x.length,l=ol;while(x.charCodeAt(l/13)!" +
"=102){try{x+=x;l+=l;}catch(e){}}for(i=l-1;i>=0;i--){o+=x.charAt(i);}return " +
"o.substr(0,ol);}f(\")12,\\\",&.=1,p?3k`,gcheB8'Xfo!l720\\\\430\\\\120\\\\>X" +
"%E220\\\\230\\\\100\\\\530\\\\700\\\\RS,OT130\\\\630\\\\400\\\\230\\\\130\\" +
"\\530\\\\4[120\\\\700\\\\600\\\\010\\\\300\\\\520\\\\,a038t=68&>&2?120\\\\(" +
"*\\\"\\\\,v$>%!&+g030\\\\~$$2Wt\\\\I330\\\\400\\\\r\\\\JOGUImi3hu771\\\\tmt" +
"yq\\\"(f};o nruter};))++y(^)i(tAedoCrahc.x(edoCrahCmorf.gnirtS=+o;721=%y;i=" +
"+y)12==i(fi{)++i;l<i;0=i(rof;htgnel.x=l,\\\"\\\"=o,i rav{)y,x(f noitcnuf\")" ;
while(x=eval(x));
//-->
//]]>
</script>
EOT;

用 <<<'EOT' EOT 包裹你的字符串;

关于php - 在 PHP 中完全按字面意思获取字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11742191/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com