Func - 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 Func.php

  1. <?php
  2. function(string $text) 
  3. {
  4.     $result = [];
  5.     $words = explode(' ', $text);
  6.     foreach($words as $word) {
  7.         if ($result[$word]) {
  8.             $result[$word] = $result[$word]++;
  9.             continue;
  10.         }
  11.         $result[$word]++;
  12.     }
  13.     return $result;
  14. }; 
File Description
  • Func
  • PHP Code
  • 14 Dec-2020
  • 279 Bytes
You can Share it: