title: how can optimization function this code in PHP smarty?
body: <p>how can optimization function this code in PHP smarty?</p>
  <p>now I've a code to confuse me, there is a simple code.</p>
  <pre><code>$sql_set_land = &quot;select * from set_new_land where id_rent_house =&quot;.Tools::getValue(&quot;id_rent_house&quot;);
              //print_r($sql_set_land);
              $n_land = Db::rowSQL($sql_set_land,true);
              $landTitle1 = $n_land['landTitle1'];
              $landTitle2 = $n_land['landTitle2'];
              $landBuilderNumber = $n_land['landBuilderNumber'];
              $landLandMark = $n_land['landLandMark'];
              $land_1 = $n_land['land_1'];
              $land_2 = $n_land['land_2'];
              $land_3 = $n_land['land_3'];
  ...
  ...
  ...
              $land_30 = $n_land['land_30'];
              $land_31 = $n_land['land_31'];
              $land_32 = $n_land['land_32'];
  </code></pre>
  <p>when I search the code that I need to push the value.</p>
  <pre><code> $this-&gt;context-&gt;smarty-&gt;assign([
                  'park_space' =&gt;$park_space,
                  'recording_data' =&gt;$recording_data,
                  'clode_number' =&gt; $clode_number,
                  'ad_choose_top' =&gt; $ad_choose_top,
                  'ad_choose_type' =&gt; $ad_choose_type,
                  'ad_choose_payment_type' =&gt; $ad_choose_payment_type,
                  'ad_choose_payment_type1' =&gt; $ad_choose_payment_type1,
                  'landTitle1' =&gt; $landTitle1,
                  'landTitle2' =&gt; $landTitle2,
                  'landBuilderNumber' =&gt; $landBuilderNumber,
                  'landLandMark' =&gt; $landLandMark,
                  'land_1' =&gt; $land_1,
                  'land_2' =&gt; $land_2,
                  'land_3' =&gt; $land_3,
  ...
  ...
  ...
                  'land_30' =&gt; $land_30,
                  'land_31' =&gt; $land_31,
                  'land_32' =&gt; $land_32,
  </code></pre>
  <p>how can optimization function? Can I write to array? if It's can write into array, how can I do?</p>