Advertisement
arijulianto

Hitung via Query String

Jun 4th, 2014
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.24 KB | None | 0 0
  1. <?php
  2. $e = explode('+',urlencode($_GET['data']));
  3. function hitung($angka1,$angka2){
  4.     $hasil = $angka1+$angka2;
  5.     return $hasil;
  6. }
  7. echo hitung($e[0],$e[1]);
  8.  
  9. // contoh rekues: http://localhost/coba.php?data=2+8
  10. // menghasilkan output: 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement