<?php require('jSearchString.php'); // The search string, usually this would have been posted from a form $searchString = 'My search !string with punctuation ;/.,# and stopwords or not with where'; // instantiate new instance $jSS = new jSearchString(); //output formatted string echo $jSS->parseString($searchString); ?>