By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,871 Members | 999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,871 IT Pros & Developers. It's quick & easy.

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

P: 12
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
Feb 27 '12 #1
Share this Question
Share on Google+
1 Reply

P: 93
$state_id = $record['state_id'];
$state_name = $recordp'state_name'];

$strstate = "<option value='".$state_id."'>".$state_name."</option>";
Apr 16 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.