PHP output_add_rewrite_var()ฟังก์ชั่น
❮ ฟังก์ชั่นการควบคุมเอาต์พุต PHP
ตัวอย่าง
เพิ่มตัวแปรให้กับ URL ในผลลัพธ์:
<?php
// Make the URL rewriter affect <a href> and <form> tags
ini_set('url_rewriter.tags','a=href,form=');
// Add a variable
output_add_rewrite_var('var', 'value');
// Output a link and a form
echo '<a href="">This link\'s URL will have a variable</a>';
echo '<form>';
echo '<p>This form will have a hidden input</p>';
echo '<input type="text"
name="hello">';
echo
'</form>';
?>
ความหมายและการใช้งาน
ฟังก์ชันoutput_add_rewrite_var()
นี้จะเพิ่มตัวแปรให้กับ URL ในแท็ก HTML และอินพุตที่ซ่อนอยู่ในแบบฟอร์ม แท็กที่ได้รับผลกระทบขึ้นอยู่กับการกำหนดค่าของการ
url_rewriter.tags
ตั้งค่าใน php.ini
ไวยากรณ์
output_add_rewrite_var(name, value);
ค่าพารามิเตอร์
Parameter | Description |
---|---|
name | The name of the variable to be added to URLs and the content of the name attribute of hidden inputs in forms. |
value | The value of the variable to be added to URLs and the content of the value attribute of hidden inputs in forms. |
รายละเอียดทางเทคนิค
คืนมูลค่า: | จริงกับความสำเร็จ เท็จเมื่อล้มเหลว |
---|---|
รุ่น PHP: | 4.3+ |
❮ ฟังก์ชั่นการควบคุมเอาต์พุต PHP