?? function.php-extract.htm
字號:
<html>
<head>
<meta content="text/html; charset=gb2312" http-equiv=Content-Type>
<title>函數:extract()</title>
<style type="text/css">
a {text-decoration: none;color:#6666ff;}
a:hover {color:#ff0000;}
</style>
</head>
<body bgcolor=ffffff leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>
<p>
<div align=center><table border=0 width=70%><tr>
<td valign=middle width=20><hr size=1 width=100%></td>
<td valign=middle nowrap><font color=e06060 size=+2><b>函數:extract()</b></font></td>
<td valign=middle width=100%><hr size=1 width=100%></td>
</tr></table></div><p>
<div align=center><table border=0 width=70%><tr><td>
<div align=right><a href="group.php-30.htm" alt="group.php?30">雜項函數庫</a></div><br><h1><font color=0000bb>extract</font></h1><p>
匯入數組到符號表。<p>
<font color=ff8000>語法:</font> <b>void extract(array var_array, int [extract_type], string [prefix]);</b><p>
<font color=ff8000>返回值:</font> 無<p>
<font color=ff8000>函數種類:</font> 資料處理<p>
<p><table border=0 cellspacing=0 cellpadding=0 width=100% height=1><tr><td height=1 bgcolor=c0c0c0><table border=0 cellspacing=0 cellpadding=0><tr><td></td></tr></table></td></tr>
<tr><td align=left><font color=ff8000>內容說明</font></td></tr></table><p>本函數用來匯入數組變量到目前使用的符號表之中。參數 var_array 為待匯入的數組變量。參數 extract_type 為輸出的類型,內定值為 EXTR_OVERWRITE,見下表<p>
<table border=1>
<tr><td>EXTR_OVERWRITE</td><td>遇相同的變量名則取而代之。</td></tr>
<tr><td>EXTR_SKIP</td><td>遇相同的變量名則略過不取代。</td></tr>
<tr><td>EXTR_PREFIX_SAME</td><td>遇相同的變量名則取新變量名稱。</td></tr>
<tr><td>EXTR_PREFIX_ALL</td><td>全部取新的變量名稱。</td></tr>
</table><p>
參數 prefix 為參數 extract_type 值為 EXTR_PREFIX_SAME 或者 EXTR_PREFIX_ALL 時,用來加在變量名稱前的字符串。<p>
<p><table border=0 cellspacing=0 cellpadding=0 width=100% height=1><tr><td height=1 bgcolor=c0c0c0><table border=0 cellspacing=0 cellpadding=0><tr><td></td></tr></table></td></tr>
<tr><td align=left><font color=ff8000>使用范例</font></td></tr></table><p><font color="#000000">
本例返回值為 紅色, 大號, 弧型, 中號,其中的 size 變量不變。<br><br><font color="#0000BB"><?<br>$size </font><font color="#007700">= </font><font color="#DD0000">"大號"</font><font color="#007700">;<br></font><font color="#0000BB">$var_array </font><font color="#007700">= array(</font><font color="#DD0000">"color" </font><font color="#007700">=> </font><font color="#DD0000">"紅色"</font><font color="#007700">,<br> </font><font color="#DD0000">"size" </font><font color="#007700">=> </font><font color="#DD0000">"中號"</font><font color="#007700">,<br> </font><font color="#DD0000">"shape" </font><font color="#007700">=> </font><font color="#DD0000">"弧型"</font><font color="#007700">);<br></font><font color="#0000BB">extract</font><font color="#007700">(</font><font color="#0000BB">$var_array</font><font color="#007700">, </font><font color="#0000BB">EXTR_PREFIX_SAME</font><font color="#007700">, </font><font color="#DD0000">"new"</font><font color="#007700">);<br>print </font><font color="#DD0000">"$color, $size, $shape, $new_size</font><font color="#007700">\n</font><font color="#DD0000">"</font><font color="#007700">;<br></font><font color="#0000BB">?></font>
</font>
<p>
<div align=center><img src="extract.gif" alt="img/extract.gif"></div>
<p><hr size=1><br>如果你對此手冊有任何問題,請到下面網址提問: <a href="www.web745.com">WEB開發知識庫</a> (<a href="http://www.web745.com">www.web745.com</a>)<p>
</td></tr></table></div>
<p>
<div align=center>
<table border=0><tr><td>[ <a href="function.php-eval.htm" alt="function.php?eval">上一頁</a> </td> <td> <a href="function.php-die.htm" alt="function.php?die">下一頁</a> ]</td></tr></table>
</div><p><br><br>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -