I am using php to pull information out of a database, but I have come to a stumbling block with this issue:
I have an extra column, where the cells contain a few different values laid out like keyword='lots of data'. This is an example of a cell’s content:
eTestOne=’This would be one sentence.
This would be another.’
eTestTwo=’1 Test
1 Other Test
2 Other Tests’
eTestThree=’This would be another entry’
So basically I need to find the keyword eTestTwo and pull out the info from the ‘quotes’ keeping the line breaks to put into separate <li> tags.
I have got sort of halfway I think. This is the php I have so far:
$pos = stripos($info['extra'], "eTestTwo='");
echo substr($info['extra'], $pos + 9 );
But this doesn’t strip off the extra information after the closing quote mark and doesn’t help me distinguish between each line to put into their own <li>:
1 Test
1 Other Test
2 Other Tests’
eTestThree=’This would be another entry’
The final output I am trying to achieve is:
<li>1 Test</li>
<li>1 Other Test</li>
<li>2 Other Tests</li>
EDIT : Just to clarify, the cell can contain more or less values in no particular order. So the solution really needs to rely on finding the keyword eTestTwo and somehow grabbing the info from between its quotes.
Edit 2:
Old anwer: