Replace a string from a submission with an empty string if string is present
<p>I have tried many combinations and a few different PHP functions, but I still can't figure out why it doesn't work.</p>

<p>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.</p>

<p>Here is my current script:</p>

<pre><code>&lt;?php
$partInStack = stristr($_POST['Title'], " (Part 1)");

if ($partInStack !== FALSE) {
$Title = str_replace($partInStack, "");
} else {
$Title = $_POST['Title'];
}
?&gt;
</code></pre>
