This is an example of what might work for you...possibly not...I'm a newbie too...
<html><head><title>Randomness</title></head>
<body>
<?php
//Here's our variable...our very long messed up string....
$veryLongString = "Hello! This is a string (yes it is a string) of course. Do you like strings? (Yes I do!) Of course, everybody likes strings! Even I do, and I'm (not) a string fan!";
//Now we change all right parentheses to left parentheses.
$change2LeftArray = explode(")",$veryLongString);
$change2LeftString = implode("(",$change2LeftArray);
$deletionArray = explode("(",$change2LeftString);
$num = 1;
$arraySize = sizeof($deletionArray)-1;
while($num<=$arraySize) {
unset($deletionArray[$num]);
$num=$num+2;
}
/*One huge problem with this program so far...what if
your string has parentheses at the start...well then
you could change the value of $num to 0, but what if the value
of $veryLongString could vary, well then I guess you'll just
have to ask users to put an insignificant character like a
tilde at the start of the message...sorry I don't know a better
way.*/
$newSortaCoolString = implode("",$deletionArray);
//Another problem...you may end up with two spaces in a row.
//Let's solve that.
$almostThereArray = explode(" ",$newSortaCoolString);
$newVeryCoolString = implode(" ",$almostThereArray);
print $newVeryCoolString;
?>
</body></html>
Yup so that's all there is to it...it works I tested it out, and have fun, and good luck on your script.