Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在cakephp中将数组的数组转换为数组_Php_Arrays_Cakephp_Variables - Fatal编程技术网

如何在cakephp中将数组的数组转换为数组

如何在cakephp中将数组的数组转换为数组,php,arrays,cakephp,variables,Php,Arrays,Cakephp,Variables,我在将数组的数组转换为数组时遇到问题 当我调试名为$todaysdata的变量时,它会显示以下输出 Array ( [0] => Array ( [Requestcard] => Array (

我在将数组的数组转换为数组时遇到问题 当我调试名为
$todaysdata
的变量时,它会显示以下输出

             Array
                 (
                   [0] => Array
                        (
                           [Requestcard] => Array
                             (
                                 [id] => 954
                                 [userprofile_id] => 14
                                 [userprofile_name] => Syed Imran
                                 [sex] => male

                              )

                         )

                )
但实际上,我希望以给定的格式输出

                           Array
                               (
                                 [Requestcard] => Array
                                    (
                                      [id] => 954
                                      [userprofile_id] => 14
                                      [userprofile_name] => Syed Imran
                                      [sex] => male

                                     )

                               )

如果有人知道的话。请帮助我。

解决您给出的示例的正确语法类似于:

$result_array = $original_array[0];

如果您有多个数组要移动,您可能需要考虑PHP的函数。

< P>解决您所给出的示例的正确语法将类似于:

$result_array = $original_array[0];

如果你有多个数组要上移,你可能需要考虑PHP的函数。

< P>只使用<代码> ARAYYSHIFT/

array_shift($array)

只需使用
array\u shift

array_shift($array)

在这种情况下,我更喜欢使用
array\u shift

在这种情况下,我更喜欢使用
array\u shift

请看。请给我看你打印数组的代码。这不是CakePHP问题,这是PHP的主要主题请看。请给我看你打印数组的代码,……这不是CakePHP问题,而是PHP的主要主题