Simple REGEX Question in PHP

avaittetods

New Member
I want to take data entered in this format:\[code\]John Smith123 Fake StreetFake City, 55555http://website.com\[/code\]and store the values in variables like so:\[code\]$name = 'John Smith';$address = '123 Fake Street';$city = 'Fake City';$zip = '55555';$website = 'http://website.com';\[/code\]So first name will be whatever is entered on the first lineaddress is whatever is on the second linecity is whatever is entered on the third line before the comma seperatorzip is whatever is on the third line after the commaand website is whatever is on the fifth lineI don't want the pattern rules to be stricter than that. Can someone please show how this can be done?
 
Back
Top