Dedecms {dede: php} label usage introduction, dedecmsdede. Dedecms {dede: php} label usage introduction. the simplest dedecmsdede input is as follows: Copy the code {dede: php} $ numA1; $ numB2; echo $ numA + $ numB; {dede: php} dededecms {dede: php} label usage from the preceding statement, dedecmsdede
The simplest input is as follows:
The code is as follows:
{Dede: php}
$ NumA = 1;
$ NumB = 2;
Echo $ numA + $ numB;
{/Dede: php}
From the preceding statement, we can see that the dede: php tag can be used in the same way in php. the above statement is written in php as follows:
The code is as follows:
$ NumA = 1;
$ NumB = 2;
Echo $ numA + $ numB;
?>
Does it look a lot like it? let's look at another judgment using the if else condition.
The code is as follows:
[Field: global runphp = 'yes' name = autoindex]
$ A ="";
$ B ="";
$ C = "<(www.111cn.net) SPAN class = 'num'> ";
If (@ me> 3) @ me = $ c. @ me. $ B;
Else @ me = $ a. @ me. $ B;
[/Field: global]
I will not write this code in php. next we should look at the use of SQL labels combined with dede php labels.
Query and output single content in combination with SQL
The code is as follows:
{Dede: php}
$ Row = $ dsql-> GetOne ('select id, typename from dede_arctype where id = 2 ');
Print_r ($ row );
{/Dede: php}
The output content is
Array
(
[Id] => 2
[Typename] => Q &
)
Isn't it easy? if you need to learn, please refer to this article.
From: http://www.111cn.net/wy/CMS/42052.htm
Http://www.bkjia.com/PHPjc/908457.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/908457.htmlTechArticlededecms {dede: php} label usage introduction, dedecmsdede simplest input such as the code below {dede: php} $ numA = 1; $ numB = 2; echo $ numA + $ numB; {/dede: php} from the above statement can be...