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
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
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
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
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','
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
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
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
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
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
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
11 matches
Mail list logo