Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-2006, 07:18 PM
Chan Chan is offline
Programming Professional
 
Join Date: Jun 2006
Posts: 205
Rep Power: 10
Chan is on a distinguished road
Default Combine two strings

In PHP how can I combine two strings like

PHP Code:
$myString "Hey";
$myString += " you"
The above doesn't seem to work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 09-19-2006, 09:23 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

I dont know but perhaps this will do:-

Code:
$first = 'Hey';
$last = ' you';
$full  = $first . ' ' . $last;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-19-2006, 02:21 PM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,149
Rep Power: 18
Lop will become famous soon enoughLop will become famous soon enough
Default

Yes, use a dot instead of the +

PHP Code:
$myString "Hey";
$myString $myString " you"
Not sure if this works, never tried:

PHP Code:
$myString "Hey";
$myString .= " you"
but I doubt it.
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-24-2006, 02:29 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

what about array_push()

edit: i wasnt fully coherant when i posted this...but the above is if you want to combined two arrays, not strings

Last edited by John; 09-25-2006 at 02:50 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-24-2006, 09:55 AM
CheeseBurgerMan CheeseBurgerMan is offline
Learning Programmer
 
Join Date: Jul 2006
Posts: 78
Rep Power: 9
CheeseBurgerMan is on a distinguished road
Default

I believe you can do that with the echo command

PHP Code:
echo $myString "another string"
EDIT: Oops, I completely misread that question. Ignore this post.

Last edited by CheeseBurgerMan; 09-24-2006 at 10:08 AM. Reason: Misread question
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 09-24-2006, 10:55 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

Quote:
Originally Posted by CheeseBurgerMan View Post
I believe you can do that with the echo command

PHP Code:
echo $myString "another string"
EDIT: Oops, I completely misread that question. Ignore this post.
So y not deleting your post? just go to Edit and press delete!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-29-2006, 07:02 PM
Chan Chan is offline
Programming Professional
 
Join Date: Jun 2006
Posts: 205
Rep Power: 10
Chan is on a distinguished road
Default

The . works - I figured it out after I posted this. Sorry for not updating and thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge Blogs? Combine RSS? Shan Abbasi Website Design 7 01-10-2008 11:44 AM
Splitting Strings with Empty Separator (Python) Matt Python 3 05-18-2007 01:27 PM
VB strings to C DLL malachi1984 Visual Basic Programming 0 05-11-2007 06:36 AM
Converting DB values into strings ashleysmithd Pascal/Delphi 5 04-24-2007 12:21 PM
Strings clookid PHP Tutorials 2 01-13-2007 04:23 PM


All times are GMT -5. The time now is 03:54 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads