Home >Backend Development >PHP Tutorial >如何把方法返回值包含到PHP代码中

如何把方法返回值包含到PHP代码中

WBOY
WBOYOriginal
2016-06-13 10:37:04735browse

怎么把方法返回值包含到PHP代码中
方法:
function pageindex($count)
{
$print="$"."SPLITNUM=".$count."; ";
$print=$print."if("."$"."_GET['go']==\"\")"."{"."$"."PAGEINDEX=1;} else"."{"."$"."PAGEINDEX="."$"."_GET['go'];}";
return $print;
}
我测试很多方法都不行

pageindex(8);

echo(pageindex(8));

print(pageindex(8));

?>

想要的包含后的PHP文件代码


$SPLITNUM=8; if($_GET['go']==""){$PAGEINDEX=1;} else{$PAGEINDEX=$_GET['go'];}

?>


------解决方案--------------------

PHP code
 $s=  pageindex(8); eval("$s;");echo $PAGEINDEX;<br><font color="#e78608">------解决方案--------------------</font><br>pageindex(8)//分装走的<br>写作<br>eval( pageindex(8) );<br><div class="clear">
                 
              
              
        
            </div>
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