Hi Everyone,
I am stuck and I am trying to get a value from a string and break it apart into 2 new strings.
IE: I have a description field that contains text like this...
6.1.6.B- Economics: Explain the basic questions that all economic systems attempt to aswser. (What goods and services should be produced? How will goods and services be produced? Who will consume goods and services?)
And break the values apart so I can format it like this...
<table width="500" border="0">
<tr>
<td width="50" valign="top"> 6.1.6.B- </td>
<td width="450" valign="top">Economics: Explain the basic questions that all economic systems attempt to aswser. (What goods and services should be produced? How will goods and services be produced? Who will consume goods and services?)</td>
</tr>
</table>
And to achieve the display format I need, I want to take the values in each instance like "6.1.6.B- " (this value is different for each and could be longer in length (IE: 13.12.4.D) and strip that out and assign it to a variable. And take the remainder of the field and assign that to another variable.
I know that the value shown above should be in a seperate field, but they did not setup the data that way and I am forced to deal with it as is.
I tried str_replace and preg_replace, but I seem to be stuck with getting an unknown "search string" value and replace with a known.
I am trying to understand a response like NogDogs here, that shows the characters like /\d etc. Where did you get the reference to convert 0001 to this?
$output[] = preg_replace('/^\d*\s*(.*)/e', 'str_replace(" ", "", trim("\\1")).".com"', $line);
I do appreciate any help/suggestions.
Thanks a bunch,
Don