1.1 - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of 1.1.php

  1. <?php
  2. function digitValue($str){
  3.         $n = filter_var($str, FILTER_SANITIZE_NUMBER_INT);
  4.         $length = strlen($n);
  5.         for ($i = 0; $i < $length; $i++){
  6.                 if (is_numeric($n[$i]))
  7.                 $zero = $length - $i -1;
  8.                 echo $n[$i] . str_repeat(0,$zero) ."\n";
  9.        
  10.         }
  11. }
  12.  
  13. digitValue('9,327,421');
File Description
  • 1.1
  • PHP Code
  • 22 Mar-2023
  • 271 Bytes
You can Share it: