Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-14-2005, 01:12 AM add two string
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
Anyone know how to add two strings or number?
I mean for example,

$name="JOHN";
$age="27";

Is there any function that can make a:-

$nameage="JOHN is 27";

Thanks.
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-14-2005, 02:05 AM
Experienced Talker

Posts: 32
Trades: 0
if i get what you talking about this should work

PHP Code:
$name="JOHN";
$age="27";

echo 
$nameage ""$name " is " $age,"";

print 
"<br>"
rcubes85 is offline
Reply With Quote
View Public Profile
 
Old 06-14-2005, 02:48 AM
rungss's Avatar
Skilled Talker

Posts: 67
Name: Bijay Rungta
Location: Mumbai, India
Trades: 0
$nameage=$name." is ".$age;

echo $nameage;
rungss is offline
Reply With Quote
View Public Profile Visit rungss's homepage!
 
Old 06-14-2005, 03:00 AM
bman's Avatar
Skilled Talker

Posts: 85
Location: USA
Trades: 0
This might work also.

$nm="Tom";
$ad="27";
$is="is"

echo "$nm\t$is\t$ad";
bman is offline
Reply With Quote
View Public Profile
 
Old 06-14-2005, 03:03 AM
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
Cool!!! I'll try each of them when I get home.
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
Old 06-14-2005, 03:34 AM
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
Now...another problem.
let say I hava:

$named="johnny/john Lee Doe";

i want the output to be only "john".
Yes.....I want to strip the rest (johnny/ Lee Doe).
Help me please.
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to add two string
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37416 seconds with 12 queries