Re: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
Sorry, doesn't work either. http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=e does not contain those that start with é: http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=é function usort_callback($a, $b) { $a = str_replace(array('à', 'é'), array('a', 'e'), strtolow

Re: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
Thanks! What does var_dump do? (I didn't really understand the manual.) "Miroslav Hudak (php/ml)" wrote: > Pardon me for the strtolower line, i've just forgot there... it's 4:30AM > here in Slovakia... :/ > > correct listing follows... > > $authors = array('élen', 'Élen', 'Elison', 'ámadeus', 'a

Re: [PHP] usort e & é together

2004-07-11 Thread Miroslav Hudak (php/ml)
Pardon me for the strtolower line, i've just forgot there... it's 4:30AM here in Slovakia... :/ correct listing follows... $authors = array('élen', 'Élen', 'Elison', 'ámadeus', 'albert', 'alfred', 'amadeus', 'elen'); function usort_callback($a, $b) { $a = str_replace(array('á', 'é'), array

Re: [PHP] usort e & é together

2004-07-11 Thread Miroslav Hudak (php/ml)
this is slightly changed function of yours, written for better readability... $authors = array('élen', 'Élen', 'Elison', 'ámadeus', 'albert', 'alfred', 'amadeus', 'elen'); function usort_callback($a, $b) { $a = strtolower($a); $b = strtolower($b); $a = str_replace(array('á', 'é'), arra

Re: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=e http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=é It still sorts "é" and "e" separately, but without a parse error: $first = array('à', 'é'); $second = array('a', 'e'); usort($authors, create_function('$a,$b','

Re: [PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread Miroslav Hudak (php/ml)
Dunno the original question, but this obviously should be escaped... So the correct code follows... usort($authors, create_function('$a,$b',' $a = str_replace(array(\'é\', \'a\'), array(\'e\', \'a\'), $a); $b = str_replace(array(\'é\', \'a\'), array(\'e\', \'a\'), $b); return strc

Re: [PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
Sorry. Still getting a parse error on line 40: 39> usort($authors, create_function('$a,$b',' 40> $a = str_replace(array('é', 'à'), array('e', 'a'), $a); 41> $b = str_replace(array('é', 'à'), array('e', 'a'), $b); 42> return strcasecmp($a,$b);')); Can you have two arrays

Re: [PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread Marek Kilimajer
I'm sorry, I used unescaped single quotes inside single quoted string, this is right: usort($authors, create_function('$a,$b',' $a = str_replace(array("é", "à"), array("e", "a"), $a); $b = str_replace(array("é", "à"), array("e", "a"), $b); return strcasecmp($a,$b);')); Joh

[PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
I went with this, but am getting a parse error. usort($authors, create_function('$a,$b',' $a = str_replace(array('é', 'à'), array('e', 'a'), $a); $b = str_replace(array('é', 'à'), array('e', 'a'), $b); return strcasecmp($a,$b);')); Anyone see it? I've got headaches from sq

Re: [PHP] usort e & é together

2004-07-11 Thread Marek Kilimajer
John Taylor-Johnston wrote: I think my problem lies in usort. I have a big honker of an array which I usort. $ausenquiry = "e"; and $ausenquiry = "e"; give a separate result. I want to conjoin them. Possible? The same would be true for "a" and "à". usort distinguishes between é and e. Any way aroun

[PHP] usort e & é together

2004-07-10 Thread John Taylor-Johnston
I think my problem lies in usort. I have a big honker of an array which I usort. $ausenquiry = "e"; and $ausenquiry = "e"; give a separate result. I want to conjoin them. Possible? The same would be true for "a" and "à". usort distinguishes between é and e. Any way around this? I don't see any i