PDA

Click to See Complete Forum and Search --> : Another weird problem. This truely is weird.


3mpty
Jan 5th, 2002, 06:13 PM
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.

???

scoutt
Jan 5th, 2002, 07:37 PM
don't have 2 nex to each other :D:D 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.

3mpty
Jan 5th, 2002, 10:04 PM
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

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

scoutt
Jan 6th, 2002, 10:09 AM
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

$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.

3mpty
Jan 6th, 2002, 03:35 PM
Nah thats perfect. my old code had to go threw eash charactor. This looks much faster.