Advertisement
ph4x35ccb

Funções dinamicas

Apr 1st, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. function teste1(){
  5.     echo "Teste funçoes dinamicas 1<br><hr>";
  6. }
  7.  
  8. function teste2(){
  9.     echo "Teste funçoes dinamicas 2<br>";
  10.     $x=0;
  11.     while($x<=10){
  12.         echo "loop: ".$x."...<br>";
  13.         $x++;
  14.     }
  15. }
  16.  
  17. $fun_A = teste1();
  18. $fun_B = teste2();
  19.  
  20. //echo $fun_A;
  21. //echo $fun_B;
  22.  
  23. echo "<hr>Com paramentro<hr>";
  24.  function teste3($parm){
  25.     echo "Teste com parametro:".$parm;
  26.  }
  27. $fun_C = 'teste3';
  28. $fun_C('Valor parametro');
  29. echo "<br><hr>";
  30. function teste4($parm2){
  31.     echo "parametro: ".$parm2;
  32. }
  33. $func_D='teste4';
  34. $func_D('2');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement