On Fri, 2 Feb 2001 04:03, [EMAIL PROTECTED] wrote:
> > Folks,
> The title is my question, how do I assign strign value into variables?
> Say , is the syntax below correct?
>
> if ($singleRooms==1) {
> $roomType ='Single Room';
> }elseif ($singleRooms==2) {
>
> }else{
> $roomType='Room Type not declared';
> }
Yup, the = is the assignment operator. You might like to take a look at
manual/en/language.operators.php at your favourite mirror for more
information on the various operators.
You could also do the above with a switch statement.
switch($singlerooms) {
case 1:
$roomType ='Single Room';
break;
case 2:
$roomType ='Double Room';
break;
......
}
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]