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

  1. <?php
  2. // Global variables
  3. function cot_cfg_paytop()
  4. {
  5.         global $cfg;
  6.        
  7.         $tpaset = str_replace("\r\n", "\n", $cfg['plugin']['paytop']['paytopareas']);
  8.         $tpaset = explode("\n", $tpaset);
  9.         $paytopset = array();
  10.         foreach ($tpaset as $lineset)
  11.         {
  12.                 $lines = explode("|", $lineset);
  13.                 $lines[0] = trim($lines[0]);
  14.                 $lines[1] = trim($lines[1]);
  15.                 $lines[2] = (float)trim($lines[2]);
  16.                 $lines[3] = (int)trim($lines[3]);
  17.                 $lines[4] = (int)trim($lines[4]);
  18.                
  19.                 if (!empty($lines[0]) && $lines[2] > 0)
  20.                 {
  21.                         $lines[3] = (!empty($lines[3])) ? $lines[3] : 2592000;
  22.                         $lines[4] = (!empty($lines[4])) ? $lines[4] : 4;
  23.                        
  24.                         $paytopset[$lines[0]]['name'] = $lines[1];
  25.                         $paytopset[$lines[0]]['cost'] = $lines[2];
  26.                         $paytopset[$lines[0]]['period'] = $lines[3];
  27.                         $paytopset[$lines[0]]['count'] = $lines[4];
  28.                 }
  29.         }
  30.         return $paytopset;
  31. }
  32.  
File Description
  • pay_top_conf
  • PHP Code
  • 03 Jul-2021
  • 827 Bytes
You can Share it: