Results 1 to 5 of 5

Thread: Another weird problem. This truely is weird.

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Australia, Syndney
    Posts
    37

    Another weird problem. This truely is weird.

    First goto
    www.c-e-v.com/xbox/CMR/wishlist.php


    you will notice a lot of 3 lenth strings. these are the condional tests.

    the databse splitter uses a (c) followed by a strange Y then the (r)

    Look towards the bottom of the list. There are 2 of them in a row. I use substr to extract contents, but for some reason it runs over the second (C)Y(r) thingy, and the output end up being (C)Y(R)H instead of 1 null string and 1 string with h.

    ???
    ______________________________
    goto www.gaminghc.com very soon

  2. #2
    scoutt
    Guest
    don't have 2 nex to each other no really I don't understand what you are trying to get out of that script.

    why use "the databse splitter uses a (c) followed by a strange Y then the (r)" when you can use | instead and makes things easy on you.

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Australia, Syndney
    Posts
    37
    ok here goes

    I use ®¥© (or as I explained (r)Y(c) ) as database seperator

    Those sets of 3 characters show whats being looked at. It looks for the ®¥© so I can then use the string locations to break up the file into an array. The problem is if 2 ®¥©'s are found in a row it doesn't break it up properly. IE,

    1®¥©doug®¥©williams®¥©email®¥©title®¥©story

    will break into an array like his
    1
    doug
    williams
    email
    title
    story
    Code:
    However if theres a null element it goes like this:
    
    1®¥©doug®¥©williams®¥©®¥©title®¥©story
                          ^Null there
    1
    doug
    williams
    ®¥©title
    story

    Im not sure, but i might be substr, not supporting a null return string
    ______________________________
    goto www.gaminghc.com very soon

  4. #4
    scoutt
    Guest
    I see what you are trying to do and I think you are going the long way around it. if all you have it data in a text file seperated by those funny looking characters, then just take them out like this
    PHP Code:
    $DataFinal=explode("®¥©",$FromFile); 

    // Listing the array inside a loop and echo about it. 
    while (list($key,$current)=each($DataFinal)){ 
    echo 
    your stuff here.

    that would do the same thing you are after and it might not make ®¥© be echoed to the screen if the data was null. plus it would shorten your code.

    if you don't want that then the only thing I can tell you is to check for ®¥© in the array and if found echo a space.

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Australia, Syndney
    Posts
    37
    Nah thats perfect. my old code had to go threw eash charactor. This looks much faster.
    ______________________________
    goto www.gaminghc.com very soon

Posting Permissions

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



Click Here to Expand Forum to Full Width