Re: Need help
| From: | Steven Walker | Date: | Thu, 21 Feb 2002 02:29:57 +0000 |
| Subject: | Re: Need help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85658@lists.php.net to get a copy of this message | ||
John,
You could create a function to do this. Just think of it in small steps. You can use the string replace function to replace certain parts with other characters, or nothing at all. For example:
$data = "Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) Henry;";
$new_data = str_replace(",(i) ", "\t", $data);
You can then use explode() to put it into an array. You'll have to figure out the details, but that should get you started.
Steven J. Walker
Walker Effects
www.walkereffects.com
steve@walkereffects.com
On Wednesday, February 20, 2002, at 06:01 PM, jtjohnston wrote:
Yeeesch! I neet help. I need a method to flush out lists of authors in a MySQL field called "KW". The field looks a bit like this: ------------------------------------------------------------------------------------------------------------------------ &&1; Caribbean and West Indies; Guyana;&&4; Birney,(i) Earle; Harris,(i) Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) Henry; Olson,(i) Charles; Rushdie,(i) Salman; Purdy,(i) Al; Joyce,(i) James; Macleish,(i) Archibald; Cummings,(i) Edward Estlin (E.E.); Auden,(i) W. H.; Atwood,(i) Margaret; Tutuola,(i) Amos; Simon,(i) Claude;&&7; comparison of authors and works; ------------------------------------------------------------------------------------------------------------------------ In the section that starts with &&4 I need to look for (i) search backward to the prewious ; and search forward to the next ; and extract into an array the contents between the semi-colons to arrive at something that looks like: Birney, Earle Harris, Wilson Hope, Alec Derwent King, Bruce James, Henry Olson, Charles Rushdie, Salman Purdy, Al Joyce, James Macleish, Archibald Cummings, Edward Estlin (E.E.) Auden, W. H. Atwood, Margaret Tutuola, Amos Simon, Claude Can someone please help me get started? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php