www.webdeveloper.com
Results 1 to 3 of 3

Thread: Can I split a text variable into two?

  1. #1
    Join Date
    May 2009
    Posts
    124

    Can I split a text variable into two?

    I'd like to take a chunk of text and search for a particular string or phrase and then split the text here into two chunks. For example:

    $phrase="This is a test.bbbNew phrase starts here"

    I'd like to be able to parse $phrase and when it comes to bbb have it recognize that this is a new phrase so that we end up with
    $phrase1="This is a test." and
    $phrase2="New phrase starts here"

    Thanks!

  2. #2
    Join Date
    May 2009
    Posts
    150
    Code:
    $phrases = explode('bbb', $phrase);

  3. #3
    Join Date
    May 2009
    Posts
    124
    Man...you guys here are fast!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles