我想將"controllers[page[title_new]]"
轉換爲"controllers[page][title_new]"
。所以,我可以填寫表格與像輸入字段:表格名稱與陣列
<?php $name = 'controllers[page[title_new]]' ?>
<input type='text' name='<?= $name; ?>'>
您提交表格後你會得到$ _ POST =
array(controllers => array(page => array(title_new = '')));
我們展示這一點,我想:
<input type='text' name='<?= $name; ?>' value='<?= $_POST[CONVERT($name)]; ?>'>
那麼在php中是否有這樣一個CONVERT
?或者我怎麼能這樣做最好的方式?
*請注意,我離開了所有的驗證/轉義/ヶ輛等,爲了便於閱讀
對不起,這不會做:(我正在尋找一種通用的方法,因此它可以處理各種控制器,而不僅僅是頁面。 – Tessmore 2012-08-14 16:07:55