NON WELL FORMED NUMERIC VALUE ENCOUNTERED IN PHP DATE

  • AUTHOR: // CATEGORY: Codeigniter, PHP

    No Comments

    If you get “non well formed numeric value encountered” error in PHP while using date() function to save into MYSQL database, use strtotime() function to correct this:

    $my_date = '20-12-2015';
    echo date('Y-m-d', strtotime($my_date));
    

    will output:
    2015-12-20
    which can be saved into MYSQL.

    LinkedInShare

    Comments

    comments

COMMENTS

0 Responses to Non Well Formed Numeric Value Encountered in PHP Date

LEAVE A REPLY

FILL THE FIELDS TO LEAVE A REPLY. Your email address will not be published.