how to stop notice 8 undefined index from appearing

-1DownUp

i am using cake to generate a json. when the notice appears, the json is no longer valid. I have my debug variable in core set to 0

Asked by vasion, on 21/1/10

the solution is: instead of using (!$_post[]) to check if the key exists, use the php function for this, which is array_key_exists

vasion - on 22/1/10

<< comments | comments >>

1 Answer

Make sure the index is defined or add a check for it.

Answered by burzumon 21/1/10

the answer is correct, my problem was in how i was checking. see my comment on the question

vasion - on 22/1/10

<< comments | comments >>
<< previous next >>

Tagged with

Rating

-1

Viewed

360 times

Last Activity

on 22/1/10