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

  1. <?php
  2.     $meta = 'a:1:{s:3:"Jan";a:1:{i:22;i:1;}}';
  3.    $userViewMeta = unserialize($meta);
  4.    for($i == 0; $i < 5; $i++){
  5.        
  6.     $getViewCount = $userViewMeta[date("M")]['d'];
  7.     var_dump()
  8.     
  9.     $newValue = $getViewCount + 1;
  10.   
  11.     $countView =  $serializedDate[date("M")][date('d')] + $newValue;
  12.     array_push($userViewMeta[date("M")],  $countView);
  13.    }
  14.                 print_r($userViewMeta);
File Description
  • view_stats
  • PHP Code
  • 23 Jan-2023
  • 408 Bytes
You can Share it: