PHP variable creation into one line

variable creation into one line

 

cdl_capture_2011-04-21-43_ 000


<?php
  ${"title_default_" . $title} = "selected";
?>

and then, for example:

<?php
  $title_select = <<<END
    <select name="title">
      <option>Select</option>
      <option $title_default_Mr  value="Mr">Mr</option>
      <option $title_default_Ms  value="Ms">Ms</option>
      <option $title_default_Mrs value="Mrs">Mrs</option>
      <option $title_default_Dr  value="Dr">Dr</option>
    </select>
END;
?>

Leave a comment