I have tried many combinations and a few different PHP functions, but I still can't figure out why it doesn't work.
Here's the deal.. If someone uses the form and the (in this case) "Title" field ends with " (Part 1)", I want to delete that string, and if it doesn't contain " (Part 1)" I want to set a variable to the Title as it was submitted.
Here is my current script:
<?php
$partInStack = stristr($_POST['Title'], " (Part 1)");
if ($partInStack !== FALSE) {
$Title = str_replace($partInStack, "");
} else {
$Title = $_POST['Title'];
}
?>