About Isset using the Generate can ' t use function return value in write context error

Source: Internet
Author: User

This problem arises when using isset to detect whether a value exists for a session

Translation: You cannot use the return value of a function in a filled-in content. Then I looked at the PHP manual to see the use of the Isset function : isset () can only be used for variables, because passing any other parameter will result in parsing errors.

Therefore, the return value is not a variable, resulting in an error. My error code was like this.

if (! Isset (session (' ID ')) | |! Isset (Session (' account ')) {    $this->redirect (' Login/index ');}

The changed code is

      $id =session (' id ');      $account =session (' account ');      if (!isset session (' ID ')) | |! Isset ($account)) {          $this->redirect (' Login/index ');      }

About Isset using the Generate can ' t use function return value in write context error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.