How to pass a database value in a hyperlink using PHP + HTML

前端 未结 4 2007
無奈伤痛
無奈伤痛 2021-01-29 06:14

I have a table in a database called Artists. It contains two bands. What I would like to do is to be able to click on the bands name using a hyper link, send that bands name to

4条回答
  •  被撕碎了的回忆
    2021-01-29 06:55

    you can use http_build_query please see http://www.php.net/http_build_query

    you can c onvert a PHP Array to a Query String… and Back Again , Please see below

     $myArray = array(  
            "car"=>array("ford", "vauxhall", "dodge"),  
            "animal"=>"elephant",  
            "language"=>"php"  
        );  
    
    echo http_build_query($myArray);  
    
    // Outputs: car[0]=ford&car[1]=vauxhall&car[2]=dodge&animal=elephant&language=php  
    
    
    $queryString = "car=ford&animal=elephant&language=php";  
    
    parse_str($queryString, $output);  
    
    print_r($output); 
    
    Array  
    (  
        [car] => ford  
        [animal] => elephant  
        [language] => php  
    )  
    

提交回复
热议问题