Jump to content

I believe this is regex stuff


jmanfffreak

Recommended Posts

Hi, I have a simple block of code that I need to pull into strings and then store to a MySQL database

 

  label: '(AB56) SOME COMPANY',
      street: '123 SOME STREET',
      city: 'SOME CITY',
      state: 'CA',
      zip: '12345',
      country: 'United States',
  email: '[email protected]',

 

I need to pull everything after each colon (:) into their own variable.

 

Hopefully, I can give what I want to be the end result, and people can guide me on how to get there.

 

$label = "AB56";
$company = "SOME COMPANY";
$street = "123 SOME STREET";
$city = "SOME CITY";
$state = "CA";
$zip = "12345";
$fname = "Some";
$lname = "Guy";
$email = "[email protected]";

 

Is something like this possible given the block of code?

 

Any guidance would be most appreciative.

 

Thanks a ton!

 

Link to comment
https://forums.phpfreaks.com/topic/252783-i-believe-this-is-regex-stuff/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.