如何从js代码中获取字符串值

I want to get the string value and later to use urldecode().

Javascript

document.write(unescape('%46%43%20%42%72%61%73%6f%76%20%76%73%2e%20%43%53%4d%53%20%49%61%73%69'));

PHP

$string = "document.write(unescape('%46%43%20%42%72%61%73%6f%76%20%76%73%2e%20%43%53%4d%53%20%49%61%73%69'));";

preg_match('/document.write(unescape(\'.*\'));/', $string,$matches);
var_dump($matches);

but this return array(0) { }

查看全部
dte66654
dte66654
2012/10/08 16:42
  • php
  • javascript
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复