PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
tores
Forum Contributor
Posts: 120 Joined: Fri Jun 18, 2004 3:04 am
Post
by tores » Wed Jul 21, 2004 11:29 am
Hi
Can someone tell me why $serie is unset in the callback-function hentSerie?
Code: Select all
<?php
/* Other function */
$serie = "A";
$Aserie = array_filter($identifikatorer, "hentSerie");
/* Callback function */
function hentSerie($element){
global $serie;
return ($serie == $element{0});
}
?>
Buddha443556
Forum Regular
Posts: 873 Joined: Fri Mar 19, 2004 1:51 pm
Post
by Buddha443556 » Wed Jul 21, 2004 3:00 pm
Seems to work for me.
Code: Select all
$identifikatorer:
array(3) {
ї0]=>
string(5) "A car"
ї1]=>
string(4) "boat"
ї2]=>
string(7) "A house"
}
$Aserie:
array(2) {
ї0]=>
string(5) "A car"
ї2]=>
string(7) "A house"
}