About the problem with the operator. For hair like this

Source: Internet
Author: User
Questions about operators. For hair like this?
PHP Code
  
  if ($item [$column _name]. $operation $info)        {            echo $item [$column _name]. $operation. $info; Echo ' =====true '; Echo '
'; return true; } else{ echo $item [$column _name]. $operation $info; Echo ' =====false '; Echo '
'; return false; } Output: 508205462=505765854=====true10>1234567=====true20<66666=====true interpretation: The result of $item [$column _name] is equivalent to the first of the operators, $operation is the operator, $info is the value, why the direct write if (10>1234567) return false, the program operation out all true??



------Solution--------------------
Because there are ".", so your variables as strings are connected together
If you want them to be an expression operation, you need the Eval function

Eval (' return '. $item [$column _name]. $operation. $info. ';')
  • Related Article

    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.