dedecms {dede:php} tag usage Introduction
The simplest input, such as
? code to copy code as follows
{dede:php}
$numA = 1;
$numB = 2;
echo $numA + $numB;
{/dede:php}
?
From the above statement can be seen dede:php tag can literally make the same use in PHP, the above statement in PHP written as follows
? code to copy code as follows
$numA = 1;
$numB = 2;
echo $numA + $numB;
?>
?
Does it look like it, and then look at another if else condition to judge
? code to copy code as follows
[Field:global runphp= ' yes ' name=autoindex]
$a = "";
$b = "";
$c = "";
if (@me > 3) @me = $c. @me. $b;
? else @me = $a. @me. $b;
[/field:global]
?
This is written in PHP, I will not write, the following we want to see Dede PHP tags combined with SQL tags.
Output single content with SQL query
? code to copy code as follows
{dede:php}
$row = $dsql->getone (' Select Id,typename from Dede_arctype where id=2 ');
Print_r ($row);
{/dede:php}
The content of this output is
Array
(
[id] = 2
[TypeName] = Q
)
is not very simple ah, have to learn a friend can refer to this article ha.
For more detailed information, please see: http://www.111cn.net/wy/CMS/42052.htm