Liquid Fire Posted April 6, 2007 Share Posted April 6, 2007 I have been converting alot of perl to php at work and was wondering soemthing, is there a way to set the value of multiple variables at one time. Here is example of perl code: my($TotPax,$TotPax2,$F_RoomPrice,$F_Sup,$F_INSAmt,$F_S,$F_Total,$F_P,$F_TotalCommission,$F_Owed,$F_Custs)=0; can i do something like: $var1, $var2, $var3, etc... = 0; i think that gives an error but is ther another way? Quote Link to comment Share on other sites More sharing options...
Jove Posted April 6, 2007 Share Posted April 6, 2007 do something like this: $var1=$var2=$var3=...=0; Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted April 6, 2007 Share Posted April 6, 2007 $var1 = $var2 = $var3 = 0; Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted April 6, 2007 Author Share Posted April 6, 2007 cool. Quote Link to comment Share on other sites More sharing options...
effigy Posted April 6, 2007 Share Posted April 6, 2007 Just a note: The Perl is not correct; it will only set $TotPax to 0 and leave the rest undefined (undef). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.