Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:35:06+00:00 2026-06-18T04:35:06+00:00

i have a php if that is returning me a error, this error: Parse

  • 0

i have a php if that is returning me a error, this error: Parse error: syntax error, unexpected ‘=’, on line that that contains this code: $result -= 'tm_year' = 1900; someone knows how to fix that ?

if (!function_exists( 'strptime' )) {
        function strptime($strdate, $format) {
            $plop = array( 's' => 'tm_sec', 'i' => 'tm_min', 'H' => 'tm_hour', 'd' => 'tm_mday', 'm' => 'tm_mon', 'Y' => 'tm_year' );
            $regexp = preg_quote( $format, '/' );
            $regexp = str_replace( array( '%d', '%m', '%Y', '%H', '%i', '%s' ), array( '(\d{2})', '(\d{2})', '(\d{4})', '(\d{2})', '(\d{2})', '(\d{2})' ), $regexp );

            if (preg_match( '/^' . $regexp . '$/', $strdate, $m )) {
                $result = array( 'tm_sec' => 0, 'tm_min' => 0, 'tm_hour' => 0, 'tm_mday' => 0, 'tm_mon' => 0, 'tm_year' => 0, 'tm_wday' => 0, 'tm_yday' => 0, 'unparsed' => '' );
                preg_match_all( '/%(\w)/', $format, $patt );
                foreach ($patt[1] as $k => $v) {
                    if (!isset( $plop[$v] )) {
                        continue;
                    }

                    $result[$plop[$v]] = intval( $m[$k + 1] );

                    if ($plop[$v] == 'tm_mon') {
                        $result -= $plop[$v] = 1;
                        continue;
                    }
                }

                $result -= 'tm_year' = 1900;
                return $result;
            }

            return false;
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:35:07+00:00Added an answer on June 18, 2026 at 4:35 am

    ‘tm_year’ is a string that you are trying to assign a value of 1900 to. You can’t do that, thus the error. Seems like a case of trying to be too cute with writing shorthand code, as one honestly can’t tell what your intent is here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this piece of code $.get('/proc.php?proc=get_color', function(data){ $('#offer_color').html(data); }); that is hosted on
MySQL is returning a syntax error for this query (via PHP): INSERT INTO links
I have php code that puts some values into an Array as follows: $hunter=addslashes($MessageArray[1]);
I have PHP scrip that goes like this: if ($cost_frm < $cost){ echo <script
I have this bit of SQL that always returns an error, though I can't
I have a PHP function that returns an array. This is the output of
I have php script that creates a temporary watermark image for users that are
I have php scripts that do things like register, login, upload. I would like
I have a php that makes some maintenance operations in my web and I
i have a php that responds to an ajax and inserts a row into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.