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

  1. <?php
  2. getbold(0,"bbbn aaaabbbsssss","bbb");
  3. function asd($q,$a,$word)
  4.  
  5. {
  6.  
  7.         for($k=$q-1; $k < strlen($a); $k++)
  8.     {
  9.             echo $a[$k];
  10.     }
  11. }
  12. function ddd($q,$a,$word)
  13.  
  14. {
  15.  
  16.         for($k=0; $k < strlen($word); $k++)
  17.     {
  18.                         echo "<b>".$a[$k]."</b>";
  19.         }
  20.         for($k=strlen($word); $k < strlen($a); $k++)
  21.     {
  22.                         echo "<b>".$a[$k]."</b>";
  23.         }
  24. }
  25.  
  26. function getbold($q,$a,$word)
  27.  
  28. {
  29.  
  30.         $a = strtr( $a, 'ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮЁ', 'йцукенгшщзхъфывапролджэячсмитьбюё' );
  31.   if(stripos($a,$word,0)==0)
  32.   {
  33.         echo ddd($q,$a,$word);
  34.   }
  35.   if(stripos($a,$word,$q) == FALSE)
  36.   {
  37.         echo $a;
  38.   }
  39.   
  40.   if($q < stripos($a,$word,$q))
  41.   {
  42.   for($q=0; $q < stripos($a,$word,$q); $q++)
  43.   {
  44.       for($i = stripos($a,$word,$q); $i < strlen($word)+stripos($a,$word,$q); $i++)
  45.       {
  46.             echo "<b>".$a[$i]."</b>";
  47.       }
  48.   }
  49.   }
  50.     if(($q > stripos($a,$word,$q)) AND ($q < strlen($a)))
  51.     {
  52.             asd($q,$a,$word);
  53.     }
  54.  }
  55. ?>
File Description
  • aa
  • PHP Code
  • 24 Dec-2020
  • 975 Bytes
You can Share it: