Im really stumped on trying to format user input. I have an input box where users enter data separated by commas. Then I explode it:
$data = $_POST['data']; $words = explode(',', $data);
then I'm analyzing each word. Everything works perfectly when you enter the data correctly. However, if someone typed in "bird, car, train,," or any other similar error it makes my results incorrect.
I'm drawing a blank on how I could build a function to format the user input to make sure there aren't errors like extra commas or other intruding characters.