Find a php code that calls txt file data and assigns values-php Tutorial

Source: Internet
Author: User
Find a php code that calls the txt file data and assigns a value to reference the txt if... else judgment statement.

Homepage file index.html
Reference File: The third line in./txt/pan.txt: false or yes
Make an if.elsesentence in index.html. the variable dovalue is the value in the third row of pan.txt;

How should I write this php?


Reply to discussion (solution)

 

Wrong. line 4.

 

 

Thank you! But what if I want to output a p layer instead of a single sentence? What should we do?
Wrong. line 4.

 

In fact, the output is

    If the do value is yes, it will be output. if it is false, it will not be output. how can this problem be achieved?
      
      
      {query:name=commend_goods as co join=left join goods as go on co.goods_id eq go.id where=co.commend_id eq 1 and go.is_del eq 0 AND go.id is not null fields=go.list_img,go.sell_price,go.name,go.market_price,go.id limit=7 order=id desc group = id}{set:$tmpId=$item['id'];}
    • {$item['name']}

      RMB{$item['sell_price']}

    • {/query}



    Wrong. line 4.
      

    What is your template language?

    If the knowledge output is correct, you can modify it and directly echo"

      "Okay. if it is false, no processing is performed. if it is false, no judgment is required to determine whether it is yes.

      In fact, the output is
        If the do value is yes, it will be output. if it is false, it will not be output. how can this problem be achieved?
            
            
          {query:name=commend_goods as co join=left join goods as go on co.goods_id eq go.id where=co.commend_id eq 1 and go.is_del eq 0 AND go.id is not null fields=go.list_img,go.sell_price,go.name,go.market_price,go.id limit=7 order=id desc group = id}{set:$tmpId=$item['id'];}
        • {$item['name']}

          RMB{$item['sell_price']}

        • {/query}




        Wrong. line 4.
            

        OK thank you!
        What is your template language?

        If the knowledge output is correct, you can modify it and directly echo"

          "Okay. if it is false, no processing is performed. if it is false, no judgment is required to determine whether it is yes.

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.