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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -