Heim  >  Artikel  >  Backend-Entwicklung  >  PHP调用出json后出来的数字 想隐藏掉 50份求高手帮忙下!

PHP调用出json后出来的数字 想隐藏掉 50份求高手帮忙下!

WBOY
WBOYOriginal
2016-06-23 13:46:54914Durchsuche

qianming.php 原文 

$code = $_GET['code'];//前端传来的code值  
$appid = "10";  
$appsecret = "张小花";  

$url = "http://123456.com/actForm.ashx?action=addorder&gameid=65&num=$appid&realname=520520&UserEmail=xiaomeng@qq.com&SearchPass=$appsecret";  
$result = https_request($url);  
$json = json_decode($result, true);
$id = explode('_',$json['msg']);
echo $id[1];
function https_request($url,$data = null){  
    $curl = curl_init();  
    curl_setopt($curl, CURLOPT_URL, $url);  
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);  
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);  
    if (!empty($data)){  
        curl_setopt($curl, CURLOPT_POST, 1);  
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);  
    }  
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
    $output = curl_exec($curl);  
    curl_close($curl);  
    return $output;  

?>  
nbsp;html>



在线提交

正在跳转页面请稍后... ...



<script>location.href='http://123456.com/dx.php?orderid=<?php echo $id[1]; ?>'</script>
打开网页显示为

14102423250754238  

nbsp;html>



在线提交


正在跳转页面请稍后... ...



<script>location.href='http://123456.com/dx.php?orderid=14102423250754238'</script>
想要把 nbsp;html>前面的 14102423250754238 去掉 直接在 下面 orderid=14102423250754238 这里显示出来  需要怎么做!求高手 帮我 


回复讨论(解决方案)

...
$id = explode('_',$json['msg']);
//echo $id[1];
function https_request($url,$data = null){  
...

昨天用了我代码,你也不测试,echo也不注释,真够懒的

昨天用了我代码,你也不测试,echo也不注释,真够懒的


昨天的帖子??解?了,?主居然?不?意?帖。?於?予?助的人?主就是???待的。
新手就已???了,?能期望?人?助,我想?的就?字,“呵呵”
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn