#1
  1. No Profile Picture
    simist
    Guest
    Devshed Newbie (0 - 499 posts)
    I'm very new to PHP3 and just started learning three days ago. I have seen on a PHP3 tutorial that with a special command data divided by space could be splitted into an array or several variables (for picking out the words of a sentence). I just couldn't find it so far. Can anyone help me?

    Thanks in advance.
  2. #2
  3. No Profile Picture
    jpenix
    Guest
    Devshed Newbie (0 - 499 posts)
    Check out the explode() function. It takes a string and chops it up into an array, splitting elements up by a delimiter that you provide.

    For example:

    $data = "This is a test";
    $sentence = explode(" ", $data);

    $sentence would now have 4 elements (0 - 3), each of which contains one of the words from the data.

Similar Threads

  1. C program to read from a data file into an array
    By rathornton in forum C Programming
    Replies: 4
    Last Post: March 16th, 2004, 11:23 AM
  2. assigning foreach loop array elements to variables
    By Volitics in forum PHP Development
    Replies: 3
    Last Post: February 16th, 2004, 04:01 PM
  3. MS Access - Splitting data one column into two
    By Robert1234 in forum Database Management
    Replies: 0
    Last Post: February 1st, 2004, 11:04 AM
  4. preg_match with mulitple array data
    By pr0teus in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 02:10 PM
  5. C++ programming help.
    By Programming1 in forum C Programming
    Replies: 1
    Last Post: January 20th, 2004, 10:47 AM

IMN logo majestic logo threadwatch logo seochat tools logo