I know this is simple but since I am a beginner I am struggling with this. I need to search for a word in $states that begins with k and ends in s both case-insensitive.
$states = "Mississippi Alabama Texas Massachusetts Kansas";
This is what I have so far but am getting PHP errors.
while ( preg_match_all("/(k+)/i and /(^s)/i", $states, $statesArray ))
I forgot to add that I need to save it to element[1] of the array statesArray. and then print out the array.
$states = "Mississippi Alabama Texas Massachusetts Kansas";
This is what I have so far but am getting PHP errors.
while ( preg_match_all("/(k+)/i and /(^s)/i", $states, $statesArray ))
I forgot to add that I need to save it to element[1] of the array statesArray. and then print out the array.