Home >Backend Development >PHP Tutorial >求PHP代码解决思路

求PHP代码解决思路

WBOY
WBOYOriginal
2016-06-13 12:25:251207browse

求PHP代码
已知:
$key=1 (是变量)
写在loop循环的,想用以下判断$num1是不是30 是错误的
{loop $list  $key.}
if($num$key == '30'){
........
}
{/loop}
也就是说$num和$key 怎么在if里组合啊?粘在一起就错误。
想让php认为得出的结果是
if($num1 == '30'){
........
}
------解决思路----------------------

$ad =<<< TXT<br />index.php#1.jpg<br />admin.php#5.jpg<br />ask.php#100.jpg<br />TXT;<br />$adlist = explode ("\n", str_replace ("\r", "", $ad));<br /><br />list($a, $b) = explode('#', $adlist[1]); //下标是从 0 算起的<br />echo "$a $b";<br />
admin.php 5.jpg

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn