PHP use variables in an array -
Currently I'm setting an array like this ...
public function Setup_array () {$ columns = array ('date1' => '2014-01-24', 'date2' => '2014-02-14', 'date3' => '2014-03 -11 ',' date4 '= & gt;' 2014-04-01 '); Return $ column; } This works, but I would like to use those variables that are already set in place of dates ...
public function Setup_Are () {$ Columns = array ('date1' => '$ date1', 'date2' => 'date1', 'date3' => 'date1', 'date4' = & Gt; '$ date1'); Return $ column; } I have tried to do this, although $ derivatives variables are available and set, it actually prints instead of $ 1 or receives variable value again.
What am I doing wrong?
remove quote
public function setup_are ($ Date1) {$ Columns = array ('date1' = & gt; $ date1, 'date2' => $ date1, 'date3' = & gt; $ date1, 'date4' => $ date1); Return $ column; }
Comments
Post a Comment