1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Norcross, GA
    Rep Power
    Say I wanted to take three string variables,

    $one = "123"
    $two = "abc"
    $three = "easy as"

    , and combine them into a single variable:

    $combined = "easy as abc 123"

    I've looked over the implode function, but I'm not sure how to arrange the statement..

    $combined = implode("", $one, $two, $three)

    Returns an error "Wrong parameter count for implode() in test.php3"

    Your help is appreciated,
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Rep Power

    Why wouldn't you do this;

    $combined = "";
    $one = "123";
    $two = "abc ";
    $three = "easy as ";

    $combined .= $three;
    $combined .= $two;
    $combined .= $one;

    echo $combined;

    Pay close att. to the original settings of the one, two three vars. The quotes and spacing are important.

    Chris Smith

Similar Threads

  1. help with fread() - strings from binary file
    By RabidRaider in forum C Programming
    Replies: 4
    Last Post: December 12th, 2003, 03:44 PM
  2. Converting numbered strings into int
    By C_rookie in forum C Programming
    Replies: 12
    Last Post: October 6th, 2003, 03:23 PM
  3. manipulating char * strings
    By infamous41md in forum C Programming
    Replies: 2
    Last Post: June 1st, 2003, 12:48 AM
  4. strings vs. constant strings (what's the difference?)
    By Matthew Doucette in forum C Programming
    Replies: 8
    Last Post: March 7th, 2003, 01:00 PM
  5. matching identical parts in two strings
    By mchess in forum PHP Development
    Replies: 11
    Last Post: June 14th, 2002, 03:07 AM

IMN logo majestic logo threadwatch logo seochat tools logo