Page 1 of 1

PHP code modification

Posted: Mon Jun 10, 2019 3:45 am
by Janusz
Hi,
I wanted to try to do some adaptation of one function but now I have one blocking point.
When I am checking with nuDebug the current array value - I have data as in the first box. So I wrote some code (in the second box) which is suppoused to generate results exactly as in the first box.
but can not get the same result despite many trials (the main problem is stdClass Object) - one of the results as example is in the last box.
And the question how to modify my code (from second box) that it will generate result exactly as visible in the first box?

Code: Select all

[0] : Array
(
    [0] => stdClass Object
        (
            [title] => Hotele - Miejsce
            [display] => hot_miejsce
            [align] => l
            [width] => 450
            [order] => 10
            [format] => 
        )

    [1] => stdClass Object
        (
            [title] => Aktualizacja
            [display] => hot_updated
            [align] => c
            [width] => 200
            [order] => 20
            [format] => 
        )

)
and I want to modify sligtly that data - but first I want to have the the code which will generate exacly result as above:
so for example with following code:

Code: Select all

$testarray = array(
'stdClass Object'=>
      array('title' => 'Hotele - Miejsce',
            'display' => 'hot_miejsce',
            'align' => 'l',
            'width' => 450,
            'order' => 10,
            'format' =>'' ,),

      array('title' => 'Aktualizacja',
            'display' => 'hot_updated',
            'align' => 'c',
            'width' => 200,
            'order' => 20,
            'format' =>'' ,),
);
I have following result:

Code: Select all

[0] : Array
(
    [stdClass Object] => Array
        (
            [title] => Hotele - Miejsce
            [display] => hot_miejsce
            [align] => l
            [width] => 450
            [order] => 10
            [format] => 
        )

    [0] => Array
        (
            [title] => Aktualizacja
            [display] => hot_updated
            [align] => c
            [width] => 200
            [order] => 20
            [format] => 
        )
)

Re: PHP code modification

Posted: Mon Jun 10, 2019 8:01 am
by kev1n
This is not a nuBuilder-specific question, maybe you could ask at stackoverflow. Normally you get answers there very quickly.

Re: PHP code modification

Posted: Mon Jun 10, 2019 11:59 am
by Janusz
Yes - you are right - the answer from stack overflow was immidiate.
I will remove soon this post not to spam this forum.

Re: PHP code modification

Posted: Mon Jun 10, 2019 12:56 pm
by kev1n
Janusz wrote:Yes - you are right - the answer from stack overflow was immidiate.
:D :D