字串函式庫

parse_str

(PHP3 , PHP4)

parse_str ---  剖析字串使它成為變數

語法 : void parse_str (string str)

說明 : 

剖析像是經由URL傳遞查詢字串的字串,並且設定變數在目前的範圍中

Example :

<?php

   $str = "first=value&second[]=this+works&second[]=another"; 

   parse_str($str); 

   echo $first;      /* prints "value" */

   echo $second[0];      /* prints "this works" */ 

   echo $second[1];      /* prints "another" */

?>


上一頁 首頁 下一頁