How can write html tag and php variables in a single line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arvind vohra
    New Member
    • Jan 2012
    • 12

    How can write html tag and php variables in a single line

    please explain me how can i write html tag and use php variable in the same line for example:-


    $strState .= '<option value = "'.$record['state_id'].'" '.$strSelected. ' >'.$record['state_name'].'</option>';


    <option > is a html tag
    $record is a php variable

    please explain me how use '' and "" quotes here
  • Bharat383
    New Member
    • Aug 2011
    • 93

    #2
    $state_id = $record['state_id'];
    $state_name = $recordp'state_ name'];

    $strstate = "<option value='".$state _id."'>".$state _name."</option>";

    Comment

    Working...