0

我正在 Openshift clound 上开发应用程序。

请看这个脚本:

 foreach ( $needle['tbody']['tr']['td'] as $key=>$values ){
      ....
      foreach( $values['table']['tr']['td'] as $value ){
        ....
        foreach ( $value['table']['tbody']['tr'] as $td_key => $td  ){

        }
        node_save($node);


$value['table']['tbody']['tr'] contains this values:
Array
(
    [0] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => tinh
                        )

                    [a] => Äồng Nai
                )

        )

    [1] => Array
        (
            [td] => 
                4K1
        )

    [2] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai8
                        )

                    [div] => 27
                )

        )

    [3] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai7
                        )

                    [div] => 490
                )

        )

    [4] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai6
                        )

                    [div] => Array
                        (
                            [0] => 9861
                            [1] => 3667
                            [2] => 9921
                        )

                )

        )

    [5] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai5
                        )

                    [div] => 0262
                )

        )

    [6] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai4
                        )

                    [div] => Array
                        (
                            [0] => 95163
                            [1] => 89551
                            [2] => 99648
                            [3] => 39782
                            [4] => 69694
                            [5] => 09915
                            [6] => 90402
                        )

                )

        )

    [7] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai3
                        )

                    [div] => Array
                        (
                            [0] => 57076
                            [1] => 54943
                        )

                )

        )

    [8] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai2
                        )

                    [div] => 07304
                )

        )

    [9] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giai1
                        )

                    [div] => 34882
                )

        )

    [10] => Array
        (
            [td] => Array
                (
                    [@attributes] => Array
                        (
                            [class] => giaidb
                        )

                    [div] => 339136
                )

        )

)

foreach ( $value['table']['tbody']['tr'] as $td_key => $td ){ ... 仅循环 2 次,无法到达 node_save($node);。我想知道 Openshift 是否限制循环?该脚本在 localhost 上运行良好。

4

1 回答 1

0

看看日志中抛出了什么会很有趣。发布您看到的任何错误: https ://www.openshift.com/faq/how-to-troubleshoot-application-issues-using-logs

于 2013-04-04T17:51:51.570 回答