Request PHP Code

Source: Internet
Author: User
Known:
$key = 1 (is a variable)
Written in loop, want to use the following judgment $NUM1 is not 30 is wrong
{Loop $list $key.}
if ($num $key = = ' 30 ') {
........
}
{/loop}
So how do $num and $key mix in if? Sticking together is wrong.
What you want PHP to think is the result
if ($num 1 = = ' 30 ') {
........
}


Reply to discussion (solution)

You are not PHP, please read the syntax of the language carefully

{Loop $list $key.}
if ($num $key = = ' 30 ') {
........
}
{/loop}

This is not PHP, it looks like a template for the view. The view template has different interpreters. There is no standard syntax. Specifically to view the document

In fact, you should be able to see what the PHP code after the explanation is.

Change it to look like this.
{Loop $list $key.}
{$num 1= $num. $key}
if ($num 1 = = ' 30 ') {
........
}
{/loop}

You are not PHP, please read the syntax of the language carefully



All right. I pasted my entire code under analysis.
In PHP:
$num 1=12, $num 2=18, $num 3=30; $aaa = 100;

In the HTM:
Please select {loop $list $k $v}$v {/loop}

Where $K is any number that is not duplicated
I want to judge {if $num $k > $aaa} ... {/if} means to use $k as a number. Equivalent
{if $num 1 > $aaa} ... {/if}
{if $num 2 > $aaa} ... {/if}
{if $num 3 > $aaa} ... {/if}
Wait a minute.
Using JS to get the value of $k can, but so judge?

I don't know what language you are using, how do you know how to write the correct code?

I don't know what language you are using, how do you know how to write the correct code?


Forget this question not tangled up, hey!
There's one more question, oh, thank you.

The background $ad is set to index.php#1.jpgadmin.php#5.jpgask.php#100.jpg and then gets the array $adlist = explode ("\ n", Str_replace ("\ R", "", $ad)); foreach ($adlist as$url=> $value) {$arr =explode (' # ', $value), $ad _types[$arr [0]]= $arr [1];}


Now the question is how do I get the second piece of data for the array? is to get admin.php#5.jpg this one.

$ad =<<< txtindex.php#1.jpgadmin.php#5.jpgask.php#100.jpgtxt; $adlist = explode ("\ n", Str_replace ("\ R", "", $ AD)); list ($a, $b) = Explode (' # ', $adlist [1]); The subscript is the echo "$a $b" from 0;
admin.php 5.jpg

$ad =<<< txtindex.php#1.jpgadmin.php#5.jpgask.php#100.jpgtxt; $adlist = explode ("\ n", Str_replace ("\ R", "", $ AD)); list ($a, $b) = Explode (' # ', $adlist [1]); The subscript is the echo "$a $b" from 0;
admin.php 5.jpg



You are really a man of God

Mixed integrals. There's no point.

  • 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.