Re: [PHP] Cut text from a string

2007-08-08 Thread Daniel Brown
On 8/7/07, Richard Lynch [EMAIL PROTECTED] wrote: preg_match('|^(.*)\\((.*)\\)$', $string, $parts); Lynch, he asked how to manipulate a string, not for you to draw him an ASCII topless dancer. ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Hey,

Re: [PHP] Cut text from a string

2007-08-08 Thread Jason Pruim
On Aug 8, 2007, at 8:54 AM, Daniel Brown wrote: On 8/7/07, Richard Lynch [EMAIL PROTECTED] wrote: preg_match('|^(.*)\\((.*)\\)$', $string, $parts); Lynch, he asked how to manipulate a string, not for you to draw him an ASCII topless dancer. ;-P Pregnant too none the less.

Re: [PHP] Cut text from a string

2007-08-08 Thread Richard Lynch
On Wed, August 8, 2007 7:54 am, Daniel Brown wrote: On 8/7/07, Richard Lynch [EMAIL PROTECTED] wrote: preg_match('|^(.*)\\((.*)\\)$', $string, $parts); Lynch, he asked how to manipulate a string, not for you to draw him an ASCII topless dancer. ;-P Yeah, and I think I left out a

Re: [PHP] Cut text from a string

2007-08-07 Thread Richard Lynch
On Thu, August 2, 2007 9:43 am, Don Don wrote: hi all, am trying to cut some texts from a serries of string values e.g. this is how we do (50 cents feat. the game) give it to me (nelly feat timerland) let me hold you (bow wow feat omarion) i want to cut off the text between the comas and

[PHP] Cut text from a string

2007-08-02 Thread Don Don
hi all, am trying to cut some texts from a serries of string values e.g. this is how we do (50 cents feat. the game) give it to me (nelly feat timerland) let me hold you (bow wow feat omarion) i want to cut off the text between the comas and i've seen some examples ? $string = Hello world,

RE: [PHP] Cut text from a string

2007-08-02 Thread Jay Blanchard
[snip] hi all, am trying to cut some texts from a serries of string values e.g. this is how we do (50 cents feat. the game) give it to me (nelly feat timerland) let me hold you (bow wow feat omarion) i want to cut off the text between the comas and i've seen some examples [/snip] Comas? Do you

Re: [PHP] Cut text from a string

2007-08-02 Thread Dan Shirah
Maybe I'm blind, but I don't see any commas in the text you are referring to. On 8/2/07, Don Don [EMAIL PROTECTED] wrote: hi all, am trying to cut some texts from a serries of string values e.g. this is how we do (50 cents feat. the game) give it to me (nelly feat timerland) let me hold

Re: [PHP] Cut text from a string

2007-08-02 Thread Daniel Brown
On 8/2/07, Dan Shirah [EMAIL PROTECTED] wrote: Maybe I'm blind, but I don't see any commas in the text you are referring to. On 8/2/07, Don Don [EMAIL PROTECTED] wrote: hi all, am trying to cut some texts from a serries of string values e.g. this is how we do (50 cents feat. the game)

Re: [PHP] Cut text from a string

2007-08-02 Thread tedd
At 11:07 AM -0400 8/2/07, Daniel Brown wrote: To remove the text between the comas would be a great feat, especially if you're still groggy from waking up from the first one. LOL! Thanks for the code. Next time I have a coma, I'll use it. Cheers, tedd -- --- http://sperling.com

Re: [PHP] Cut text from a string

2007-08-02 Thread Don Don
I meant i want to get rid of the braces. e.g. get the text up to the start of the first brace and ignore anything from the first brace onwards Dan Shirah [EMAIL PROTECTED] wrote: Maybe I'm blind, but I don't see any commas in the text you are referring to. On 8/2/07, Don Don wrote: hi all,

Re: [PHP] Cut text from a string

2007-08-02 Thread Daniel Brown
On 8/2/07, Don Don [EMAIL PROTECTED] wrote: I meant i want to get rid of the braces. e.g. get the text up to the start of the first brace and ignore anything from the first brace onwards Dan Shirah [EMAIL PROTECTED] wrote: Maybe I'm blind, but I don't see any commas in the text you are

Re: [PHP] Cut text from a string

2007-08-02 Thread Crash Dummy
I meant i want to get rid of the braces. e.g. get the text up to the start of the first brace and ignore anything from the first brace onwards I don't see any braces, either. For the record: brace = {} bracket = [] parentheses = () comma = , semicolon = ; To extract the partial string leading

[PHP] cut text after saving file with php

2002-06-21 Thread Georg Buske
Hello, I want to save a text - which is created in a selfmade javascipt editor - into a .cnt - file with php... It works fantastically if I work in the LAN - environment, but if I work from outside - it's still saving, but it cuts contingent some text...! I can't I understand why it doesn't

[PHP] cut text?

2002-06-11 Thread Hawk
I've been looking on the php.net page, but I don't know what to look for.. I found string mb_strcut ( string str, int start [, int length [, string encoding]]) and it looks like the thing I'm looking for, but I don't know how to use it :) can anyone tell me? :P HÃ¥kan -- PHP General Mailing

Re: [PHP] cut text?

2002-06-11 Thread Chris Hewitt
What exactly are you trying to do? If you tell us more, we can help better. Chris Hawk wrote: I've been looking on the php.net page, but I don't know what to look for.. I found string mb_strcut ( string str, int start [, int length [, string encoding]]) and it looks like the thing I'm looking

Re: [PHP] cut text?

2002-06-11 Thread Hawk
Lets say I have a news text, and in a menu, I just want to print the first.. lets say 30 letters, and maybe add a ... after, and link it to the full text. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] cut text?

2002-06-11 Thread Jason Wong
On Wednesday 12 June 2002 03:36, Hawk wrote: Lets say I have a news text, and in a menu, I just want to print the first.. lets say 30 letters, and maybe add a ... after, and link it to the full text. substr(), wordwrap() -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source

Re: [PHP] cut text?

2002-06-11 Thread Chris Hewitt
I'd probably use substr. For the first 30 characters plus three full stops (untested): $shortstring = substr($longstring,0,30); The manual shows all the string handling functions http://www.php.net/manual/en/ref.strings.php Regards Chris Hawk wrote: Lets say I have a news text, and in

Re: [PHP] cut text?

2002-06-11 Thread Scott Hurring
Try (this is untested) if (length($string) 30) { print substr($string, 0, 30) ; } else { print $string; } --OR-- (if you want to over-write $string) $string = ((length($string) = 30) ? substring($string, 0, 30) : $string ); -- Scott Hurring Systems Programmer EAC Corporation