I've got the following data in a db
[508] [blah-blah-blah] Random Text
[510] [hello-hello-hello] More random text
[542] [stuff-stuff-stuff] Even more text
This is in quite a lot of db cells. The whole block of text is in a cell and each row of the text is separated by a carriage return.
Ideally i want the number in the first square bracket on each line into array values. The data i want to end up with is:
array(508,510,542)
More importantly, i want to see how to efficiently get that first data structure into a array. i feel like there should be a simple efficient way to use it, but, aside from some really complex regex i cannot see how to do it :(
Any help would be magical!