Jump to content

filter undefined = NULL array setting


n33dl3

Recommended Posts

Hi,

I have an array with the following entry:

$rec['REC_DATE']: array=0: undefined=NULL

If the REC_DATE entry is NULL I would like to set REC_DATE with today's date, and if REC_DATE is not NULL then nothing should happen.

What would be the best way to achieve this, I have tried it with :

if (!array_key_exists('REC_DATE', $res))

    {

    $res['REC_DATE']=$today;

    }

but that is not working.

Thnx

Regards

 

Link to comment
https://forums.phpfreaks.com/topic/42236-filter-undefined-null-array-setting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.