I currently have a PDO script that contains a POST variable that can be either:
RU11223344992 PS:1201012
OR RU11223344992
If the value is like RU11223344992 PS:1201012
the script should interpret it by taking all values to the left of PS:1201012
leaving only RU11223344992
If the value is like RU11223344992
it should interpret it just the way it is.
Depending on this conditional, the value will be assigned to the variable PostValue
.
UPDATE:
Using the suggested solution I getting the response Array
when doing echo $data
$input = $_POST['postvalue'];
if (strpos($input, "PS: "))
{
$data = explode($input, "PS: ");
}
else{
$data = $input;
}
echo $data;