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

  1. <?php
  2. session_start();
  3. $first_string = "";
  4. $second_string = "";
  5. if (!isset($_SESSION['first_string'])) {
  6.   echo "No field first_string in session";
  7. } else{
  8.   $source1 = $_SESSION['first_string']
  9.   $d1 = array();
  10.   for($i=0; $i<strlen($s1); $i++) 
  11.          if ($i % 2 == 0){
  12.             $d1[$i] = $s1[$i];
  13.          }
  14.  
  15.   $first_string = implode("", $d1);
  16. }
  17.  
  18. if (!isset($_SESSION['second_string'])) {
  19.   echo "No field second_string in session";
  20. } else{
  21.   $source = $_SESSION['first_string']
  22.   $d2 = array();
  23.   for($i=0; $i<strlen($s2); $i++) 
  24.          if ($i % 2 != 0){
  25.             $d2[$i] = $s2[$i];
  26.          }
  27.  
  28.   $second_string = implode("", $d2);
  29. }
  30.  
  31. $result = $data1 . $data2; 
  32.  
  33. $_SESSION['result'] = $result;
  34.  
  35.  
  36. ?>
File Description
  • sdsd
  • PHP Code
  • 29 Apr-2022
  • 749 Bytes
You can Share it: