[PHP] Re: Remove cahracters in string
Mike Mapsnac [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I search on php.net and couldn't find the function. I need a function that will remove characters in the string until it reached the pattern and remove characters in the string after another pattern. The program reads huge file, and remove unnessary data. So I need to remove characters before and after the line. Could you post an example to make absolutely clear what you have and what you want? Thanks. Torsten FedoraPHPLINUXOct72004 _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Remove cahracters in string
Below is string let's name it A. ttPhiladelphiaFirstadate05Oct2004tt I want to get string B. That looks like PhiladelphiaFirstadate05Oct2004 No characters before Philadelphia and after 20004 From: Torsten Roehr [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Re: Remove cahracters in string Date: Mon, 10 May 2004 22:37:36 +0200 Mike Mapsnac [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I search on php.net and couldn't find the function. I need a function that will remove characters in the string until it reached the pattern and remove characters in the string after another pattern. The program reads huge file, and remove unnessary data. So I need to remove characters before and after the line. Could you post an example to make absolutely clear what you have and what you want? Thanks. Torsten FedoraPHPLINUXOct72004 _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Remove cahracters in string
Mike Mapsnac [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Below is string let's name it A. ttPhiladelphiaFirstadate05Oct2004tt I want to get string B. That looks like PhiladelphiaFirstadate05Oct2004 No characters before Philadelphia and after 20004 Is the character you want to remove ('t') always the same? Torsten From: Torsten Roehr [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Re: Remove cahracters in string Date: Mon, 10 May 2004 22:37:36 +0200 Mike Mapsnac [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I search on php.net and couldn't find the function. I need a function that will remove characters in the string until it reached the pattern and remove characters in the string after another pattern. The program reads huge file, and remove unnessary data. So I need to remove characters before and after the line. Could you post an example to make absolutely clear what you have and what you want? Thanks. Torsten FedoraPHPLINUXOct72004 _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Remove cahracters in string
No. It just an example From: Torsten Roehr [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Remove cahracters in string Date: Mon, 10 May 2004 22:49:27 +0200 Mike Mapsnac [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Below is string let's name it A. ttPhiladelphiaFirstadate05Oct2004tt I want to get string B. That looks like PhiladelphiaFirstadate05Oct2004 No characters before Philadelphia and after 20004 Is the character you want to remove ('t') always the same? Torsten From: Torsten Roehr [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Re: Remove cahracters in string Date: Mon, 10 May 2004 22:37:36 +0200 Mike Mapsnac [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I search on php.net and couldn't find the function. I need a function that will remove characters in the string until it reached the pattern and remove characters in the string after another pattern. The program reads huge file, and remove unnessary data. So I need to remove characters before and after the line. Could you post an example to make absolutely clear what you have and what you want? Thanks. Torsten FedoraPHPLINUXOct72004 _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Check out the coupons and bargains on MSN Offers! http://youroffers.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Remove cahracters in string
Below is string let's name it A. ttPhiladelphiaFirstadate05Oct2004ttt ttt I want to get string B. That looks like PhiladelphiaFirstadate05Oct2004 No characters before Philadelphia and after 20004 Is the character you want to remove ('t') always the same? No. It just an example An accurate example of what you're actually going to be doing would help. For this example I would have suggested: ?php $str = PhiladelphiaFirstadate05Oct2004; $str = trim( $str, t ); print( $str ); // outputs PhiladelphiaFirstadate05Oct2004 ? Cheers, Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Remove cahracters in string
For this example I would have suggested: ?php $str = PhiladelphiaFirstadate05Oct2004; $str = trim( $str, t ); print( $str ); // outputs PhiladelphiaFirstadate05Oct2004 ? Cheers, Rick t is not static character. My example isn't correct Correct Example: tdahregdgfdhPhiladelphiaFirstadate05Oct2004ahahrehbGSG Ok. What do you know for certain about the leading and trailing garbage? For Example: Is it always lowercase? Is it always the same number of characters? Will the trailing garbage always begin after a 4 digit number? There has to be some known characteristic of the junk before you can trim it programmatically. Otherwise you'll never be able to trim it with absolute accuracy. Hope that makes sense. Rick (Please reply to the list, by the way. Otherwise it doesn't help anyone else.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php