</body> </html> <?php include "ribaltastringa_class.php"; if (isset($_POST['string']) && isset($_POST['divider'])) { $textModifier = new Mystring($_POST['string'], $_POST['divider']); switch ($_POST['textmodify']) { case "reverse": echo "Reversed string is ->" . $textModifier->reverseString() . "<br />"; break; case "divide": if ($_POST['string'] != "" && $_POST['divider'] != "") { $output = $textModifier->divideString(); echo "Text input is -> '" . $_POST['string'] . "'<br />" . "Divider is -> '" . $output[0] . "'<br />" . "Modified text is: <br />First part -> '" . $output[1] . "'<br />Second part -> '" . $output[2] . "'"; exit; } else { echo "You need to input something!"; } break; case "bold": if ($_POST['string'] != "" && $_POST['divider'] != "") { $bold = $textModifier->boldString()[1] . $textModifier->boldString()[0] . $textModifier->boldString()[2]; echo "Bolded text-> " . $bold . " <br />"; exit; } else { echo "You need to input something!"; } break;