Not sure what I am doing wrong? Never ran into this issue before? But this is also the first function I have written.
<?php
function category($string){
if(preg_match("/(Slimming|Laser|Spa|Massage|Manicure|Pedicure)/i", $string)){
echo 'Spa';
}
} // This is function.php
$title = 'Spa';
include 'function.php';
$category = category($title);
$category = mysql_real_escape_string($category);
echo "$category<br>"; // I get Spa
var_dump("$category"); //added for testing, I get string(0) ""
$category is then sent to a mysql insert, the value is blank in the database...
Thanks for the help.