Home  >  Article  >  Backend Development  >  @include("$r[title].php"); 应该如何写,有个变量

@include("$r[title].php"); 应该如何写,有个变量

WBOY
WBOYOriginal
2016-06-13 12:18:08871browse

@include("$r[title].php"); 应该怎么写,有个变量
$r[title]的值为youku或者tudou或者qiyi
但是里面有变量,怎么加引号之类的就是不行,求解决
------解决思路----------------------
r[title].'.php'
------解决思路----------------------
include("{$r['title']}.php");

这样写
------解决思路----------------------

$file = $r[title].php;
include($file); 

这样简单些

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