Forum Moderators: coopster
THE FORMAT OF THE DATA:
Label "option1" "option2" "option3"
The Label is the first element of this and is not enclosed in quotes, the individual options however are enclosed in quotes.
So i need to validate that the user entered the data in this format with unlimited "options"
The second part would be to at a later time get this data and put it into an array with the "Label" as the [0] element of an array to make an array like this.
$array[0] == "Label"
$array[1] == "option1"
$array[2] == "option2"
$array[3] == "option3"
Thanks alot, and any ideas would really help tons!
Ryan
^([a-z])+ (\"([a-z])+\" )+$will not match the Label "option1" etc that you posted.
$pattern = '%([a-z]+) ("[a-z]+\d"...space in here...?)+%i'; will match what you put up. Stupid forum removing spaces...
Dont know if your problem is sorted as you are using different data to the example, or if you havent tested your work. So this may, or may not help you ;)