Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public function getStats($request){
  2.  
  3. // some custom input filtering
  4.  
  5. $params = array('uid' => $this->uid);
  6. $reply = $db->get($query,$params);
  7.  
  8. return function() use (&$reply){
  9.  
  10. //localization of some strings
  11.  
  12. return $reply;
  13. };
  14. }
  15.  
  16. public function getStats($request){
  17.  
  18. // some custom input filtering
  19.  
  20. $params = array('uid' => $this->uid);
  21. $reply = $db->get($query,$params);
  22.  
  23. $myfunction = function() use ($reply){
  24.  
  25. //localization of some strings
  26.  
  27. return $reply;
  28. };
  29.  
  30. return $myfunction();
  31. }
  32.  
  33. <?php
  34. $greet = function($name)
  35. {
  36. printf("Hello %srn", $name);
  37. };
  38.  
  39. $greet('World');
  40. $greet('PHP');
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement