Current location: Hot Scripts Forums » Programming Languages » PHP » store two variables in a single variable


store two variables in a single variable

Reply
  #1 (permalink)  
Old 05-18-11, 10:47 AM
faisals999 faisals999 is offline
Newbie Coder
 
Join Date: May 2011
Location: Sargodha, Pakistan
Posts: 27
Thanks: 4
Thanked 0 Times in 0 Posts
store two variables in a single variable

hey everyone.............
I want to store two variables in a single variable. Is it possible???
Kindly tell me. I have to submit my project tomorrow.
Reply With Quote
  #2 (permalink)  
Old 05-18-11, 11:19 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
PHP Code:

$both $var1 $var2
... if that's what you mean.
Reply With Quote
  #3 (permalink)  
Old 05-18-11, 04:20 PM
faisals999 faisals999 is offline
Newbie Coder
 
Join Date: May 2011
Location: Sargodha, Pakistan
Posts: 27
Thanks: 4
Thanked 0 Times in 0 Posts
No its not working......
I want to store following value

PHP Code:

$flight=$flight1.on.$date
means that output should be something like this...... pk-345.on.2011/05/11
Reply With Quote
  #4 (permalink)  
Old 05-18-11, 04:52 PM
davestar057 davestar057 is offline
Wannabe Coder
 
Join Date: Dec 2007
Posts: 115
Thanks: 1
Thanked 1 Time in 1 Post
I think this is what you want....

PHP Code:

$flight=$flight1.' on '.$date
__________________
New Wave Creative Media
Reply With Quote
  #5 (permalink)  
Old 05-18-11, 09:03 PM
faisals999 faisals999 is offline
Newbie Coder
 
Join Date: May 2011
Location: Sargodha, Pakistan
Posts: 27
Thanks: 4
Thanked 0 Times in 0 Posts
unfortunately this too is not working..........
Reply With Quote
  #6 (permalink)  
Old 05-19-11, 02:10 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
PHP Code:

$flight $flight1 '.on.' $date
Reply With Quote
The Following User Says Thank You to Nico For This Useful Post:
faisals999 (05-19-11)
  #7 (permalink)  
Old 05-19-11, 11:38 AM
calx44 calx44 is offline
Newbie Coder
 
Join Date: Apr 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
this should work

$flight = $flight1 . "on" . date;

you will need the spaces between around the "."
Reply With Quote
  #8 (permalink)  
Old 05-19-11, 01:44 PM
faisals999 faisals999 is offline
Newbie Coder
 
Join Date: May 2011
Location: Sargodha, Pakistan
Posts: 27
Thanks: 4
Thanked 0 Times in 0 Posts
thanx everyone for helping
Reply With Quote
  #9 (permalink)  
Old 05-19-11, 01:53 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Quote:
Originally Posted by calx44 View Post
this should work

$flight = $flight1 . "on" . date;

you will need the spaces between around the "."
No you don't.
PHP Code:

$flight $flight1 ' on ' $date;

$flight $flight1.' on '.$date
The two lines above are functionally identical.
__________________
The toxic ZCE
Reply With Quote
Reply

Bookmarks

Tags
php variables, single variable, store, two variables


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable Variables lkegley9 Flash & ActionScript 1 08-18-07 11:42 PM
Store result of function in variable HairySpider PHP 4 09-10-06 03:43 PM
using variable variables with multiple variables for parts of the name harlock PHP 7 07-26-05 07:35 PM


All times are GMT -5. The time now is 08:48 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.