1. 程式人生 > >CI框架input get post (_fetch_from_array)

CI框架input get post (_fetch_from_array)

 $index='444?487d?[[^44]][\][]';
    $count = preg_match_all('/^[^[]+/', $index, $matches);
    var_dump($count,$matches);
    //$count = preg_match_all('/[^\]*/', $index, $matches);//Message:  preg_match_all(): Compilation failed: missing terminating ] for character class
    //$count = preg_match_all('/[^\\]*/', $index, $matches);//Message:  preg_match_all(): Compilation failed: missing terminating ] for character class
//$count = preg_match_all('/[^\\\\]*/', $index, $matches); //$count = preg_match_all('/[^\\\]*/', $index, $matches); $count = preg_match_all('/[\?\d]+/', $index, $matches); var_dump($count,$matches); $count = preg_match_all('/[^?\\d]+/', $index, $matches); var_dump($count,$matches); $index
='[a][b][c]'; preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches); var_dump($count,$matches); echo '<hr>'; //http://www.ci.izanzan.cn/?stu[age][tom]=10&stu[age][lily]=29&stu[age][]=24&stu[age][]=22 var_dump($_GET);//array(1) { ["stu"]=> array(1) { ["age"]=> array(4) { ["tom"]=> string(2) "10" ["lily"]=> string(2) "29" [0]=> string(2) "24" [1]=> string(2) "22" } } }
var_dump(2222,$this->input->get('[stu][age][tom]')); echo '<hr>'; var_dump(222,test());//testtestint(222) NULL function test(){ echo __METHOD__; echo __FUNCTION__; }