开发者

zend, getting a param that a value of http://

开发者 https://www.devze.com 2023-03-14 17:49 出处:网络
im trying to get a param from my url.. via $this->_request->getParam(\'url\') so,/url/http://www.yahoo.com

im trying to get a param from my url.. via $this->_request->getParam('url')

so, /url/http://www.yahoo.com

but the value of param url is h because theres forward slashes in the value.. how can i get the full url... as now, its thinking that the http:// is another param..

    public function getUrlToGo(){

$url=$this->_request->getParam('url')开发者_运维技巧;
if ($url='http://www.yahoo.com'){
return $this->_forward("findyahoo", "urlclass");

}
}


Usually when urls are passed in the address bar the slashes (and most other characters) are converted into url-safe characters.

<?php
$url = urlencode('http://www.yahoo.com');
echo $url; //http%3A%2F%2Fwww.yahoo.com

You can then use urldecode($url) to get the original url back.

0

精彩评论

暂无评论...
验证码 换一张
取 消