SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create an array of a list

    Hello,

    I have a little problem with arrays...

    I have a list of domains like this:

    domain1.com
    domain2.com
    domain3.com

    with simple \n breaks. What I want is the result like file() does with a textfile.

    So all domains in one array (there are max 30 domains in the list).

    Any suggestions?

  2. #2
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your list of domains is a string right

    you can explode() them or use preg_split() to put the string into an array...

  3. #3
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes it is a string.

    Well euh, explode() works nice

    Thanks!


Bookmarks

Posting Permissions

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