将变量添加到函数中


adding a variable into a function

你好,我有一个granit php函数,但我想把我自己的文本打印到它中,它存储在一个变量中。

这就是在我输入变量之前代码的样子:

 gradient('FF0000', '0000FF', 'my test goes here'); 

这很好,但现在我想把变量放在文本所在的位置,就像一样

   gradient('FF0000', '0000FF', '".$profile."'); 

它只是在页面上回响出$profile。我可以回显$profile,它工作得很好,但我想添加grant函数。

我做错了什么??

简单地说:

gradient('FF0000', '0000FF', $profile); 

或者:

$color1 = 'FF0000';
$color2 = '0000FF';
$profile = 'my test goes here';
gradient($colour1, $colour2, $profile);
$profile = 'my test goes here';
gradient('FF0000', '0000FF', $profile); 

会起作用的。