Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default PHP: Help with explode ect ect.

    Hey guys I am looking for some help for my user system pips

    Okay this is what I have writen

    PHP Code:
    $one 'pipone.gif|piptwo.gif|pipthree.gif|pipfour.gif';
    explode('|'$one);
    $two = array("$one");
    reset($two);
    while (list(, 
    $three) = each($two)) {
    echo 
    "<img src='$three' />";

    this is simply outputing a dead image that is called "pipone.gif|piptwo.gif|pipthree.gif|pipfour.gi f" so I guess the explode has been used wrong?

    Thanks guys,
    Danny
    Last edited by Luckyrare; 23-02-2006 at 11:55 PM.

  2. #2
    Join Date
    Feb 2006
    Location
    Manchester UK
    Posts
    156
    Tokens
    0

    Default

    Well it looks to me like you are using explode correctly but if I understand correctly do you not have to echo $one like:

    PHP Code:
    explode('|'$one);
    echo 
    '$one'
    I've never really needed to use explode so I may be wrong.

  3. #3
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    No that will just print the arrays with an image. Thanks for your idea anyway
    Last edited by Luckyrare; 24-02-2006 at 08:34 AM.

  4. #4
    Join Date
    Jun 2005
    Location
    Leeds
    Posts
    698
    Tokens
    0

    Default

    yo dan

    mat64 (Forum moderator) - Please don't post pointless messages.
    Last edited by mat64; 25-02-2006 at 12:43 PM.

  5. #5
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    as I understand it the explode() command returns an array of a split string so you dont need to use an array()...

    for example..
    PHP Code:
    $line "Hello|World|1|Dog";
    $explode explode("|"$line);
    echo 
    $explode[0]; //Would echo Hello
    echo $explode[1]; //Would echo World
    echo $explode[2]; //Would echo 1
    echo $explode[3]; //Would echo Dog 
    Last edited by Splinter; 24-02-2006 at 09:59 AM.

  6. #6
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    mmmm, is there any better way of doing this so I can have as many arrays/pips as I want but without having to number them.

    Thanks,

  7. #7
    Join Date
    Feb 2006
    Location
    Manchester UK
    Posts
    156
    Tokens
    0

    Default

    I thought as Splinter said you had to echo them I was just not sure in which way.
    I'm extremely critical and mean..

  8. #8
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    ah yes spliter that will work for me. I would rep you but I cant

    Thanks dude

    closed

Posting Permissions

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