php: two objects from the same class work independent of each other
- by user317563
Good morning,
I would like the code in my controller to look something like this:
<?php
$class = new sanitizeInput()
$string1 = $class -> input($_POST[name]) -> mysql_escape();
$string2 = $class -> input($_POST[age]) -> mysql_escape();
print "
String1: $string1 <br />
String2: $string2"
?>
It seems with my sanitizeInput class, any change to $string2 is applied to $string1.
What ways can I change this? I would preferably like to make the changes within the class to make my controller as easily read as possible.
Thank you for your time.
Kind regards,
Marius