fork download
  1. <?php
  2.  
  3. $l ="3304062901910005";
  4. $z = str_split($l);
  5. $x = array();
  6. $j = 0;
  7. $k = 0;
  8. $za= strlen($l);
  9. for ($i=0;$i<$za;$i++) {
  10. if ($j>=4){
  11. if ($k < 4) {
  12.  
  13. $x[$i] = $z[$i-4];
  14.  
  15. $k++;
  16.  
  17. }
  18.  
  19.  
  20. else
  21.  
  22.  
  23. {
  24.  
  25.  
  26. $x[$i] = $z[$i+4];
  27.  
  28.  
  29. $j = 0;
  30.  
  31.  
  32. $k = 0;
  33.  
  34.  
  35. }
  36.  
  37.  
  38. }
  39. else
  40. {
  41. $x[$i] = $z[$i+4];
  42. }
  43. $j++;
  44. }
  45. echo "no ktp $l<br/>";
  46. $d= implode($x);
  47. echo "Hasil $d";
  48. ?>
  49.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:1: error: expected identifier or '('
<?php
^
prog.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
$z = str_split($l);
^
prog.c:4:6: warning: implicit declaration of function 'str_split' is invalid in C99 [-Wimplicit-function-declaration]
$z = str_split($l);
     ^
prog.c:4:16: error: use of undeclared identifier '$l'
$z = str_split($l);
               ^
prog.c:5:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
$x = array();
^
prog.c:5:6: warning: implicit declaration of function 'array' is invalid in C99 [-Wimplicit-function-declaration]
$x = array();
     ^
prog.c:5:6: error: initializer element is not a compile-time constant
$x = array();
     ^~~~~~~
prog.c:6:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
$j = 0;
^
prog.c:7:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
$k = 0;
^
prog.c:8:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
$za= strlen($l);
^
prog.c:8:6: warning: implicitly declaring library function 'strlen' with type 'unsigned int (const char *)'
$za= strlen($l);
     ^
prog.c:8:6: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
prog.c:8:13: error: use of undeclared identifier '$l'
$za= strlen($l);
            ^
prog.c:9:1: error: expected identifier or '('
for ($i=0;$i<$za;$i++) {
^
prog.c:45:1: error: unknown type name 'echo'
echo "no ktp $l<br/>";
^
prog.c:45:6: error: expected identifier or '('
echo "no ktp $l<br/>";
     ^
prog.c:46:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
$d= implode($x);
^
prog.c:46:5: warning: implicit declaration of function 'implode' is invalid in C99 [-Wimplicit-function-declaration]
$d= implode($x);
    ^
prog.c:46:5: error: initializer element is not a compile-time constant
$d= implode($x);
    ^~~~~~~~~~~
prog.c:47:1: error: unknown type name 'echo'
echo "Hasil $d";
^
prog.c:47:6: error: expected identifier or '('
echo "Hasil $d";
     ^
prog.c:48:1: error: expected identifier or '('
?>
^
10 warnings and 11 errors generated.
stdout
Standard output is empty