body{background-color: $ bgcolor;color:$font_color;font-size: $font_size;}";"/> body{background-color: $ bgcolor;color:$font_color;font-size: $font_size;}";">
Home >Backend Development >PHP Tutorial >php learning (2)
php function:
<code><span><?php</span><span>//该函数生成一个css</span><span><span>function</span><span>page</span><span>(<span>$bgcolor</span> = NULL,<span>$font_color</span> = NULL,<span>$font_size</span>)</span>{</span><span>echo</span><span>"<style> body{ background-color: $bgcolor; color:$font_color; font-size: $font_size; }</style>"</span>; } page(<span>'red'</span>,<span>'green'</span>,<span>'24'</span>); <span>?></span></code>
The above introduces PHP learning (2), including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.