Ben bir dize / metin manipülasyon app inşa etmek istiyorum:
An app consists of a form User inputs text there as a string using Click a button - which usues $_POST method to manipulate a string using oop method to :
Bir düğmeye atanmış örnek yöntemi:
public function revers_sentence() {
$this->string = strrev($this->string);
return $this;
}
Then the manipulated string is displayed in the same form. User can do another manipulation with a converted string
How to assign method to a button to trigger the function and display results in the same form? Can it be achived in a single php file to send and get a result? (I want to store my classes in a seperate file)
Herhangi bir yardım / fikir Takdir - herhangi bir bilge adam?
edit:
<?php
require_once('mod.php');
$string='';
if (isset($_POST['string']))
$string=$_POST['string'];
if (isset($_POST['DoStuff']))
{
//$string = reverse_1_word($string);
**$string->reverse();**<-------------------------------Fatal error:---------
}
if (isset($_POST['DoOtherStuff']))
{
$string = doOtherStuffWithThisString($string);
}
?>
Fatal error: Call to a member function odwroc() on a non-object on line 14 bu yüzden her yeni dize bir nesne nasıl?