Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]array_map i wywolanie funkcji zdefiniowanej w class
piasekps
post
Post #1





Grupa: Zarejestrowani
Postów: 56
Pomógł: 0
Dołączył: 26.03.2007

Ostrzeżenie: (0%)
-----


witam

mam problem z array_map
skorzystalem z przykladu nr dwa z stripslashes
i przepisalem funkcje wywalajaca slashe z podanej zmiennej,
problem polega na tym ze nie dziala gdy funkcja jest czescia class'y
w przykladzie ponizszym dostaje spowrotem taki sam string jaki wprowadzam
  1. function subSlash ($value)
  2. {return is_array($value) ? array_map($this->subSlash, $value) : stripslashes($value);}

zakladam ze blednie wprowadzam nazwe/namiary na funkcje
probowalem zamiast $this->subSlash rowniez:
'$this->subSlash',
'subSlash',
'class_name::subSlash',
class_name::subSlash

i wyskoczyl mi taki blad:

Warning: array_map() [function.array-map]: The first argument, ‘$this->subSlash’, should be either NULL or a valid callback in sysInfo.class.php on line 249

ale jak w/w funkcja nie jest w class'ie to ladnie smiga
co robie zle?

dzieki za pomoc
p.s.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 12:12