Re: [PHP] Trimming Text

2005-07-17 Thread Ben-Nes Yonatan
André Medeiros wrote: On Fri, 2005-07-15 at 16:03 +0100, Richard Davey wrote: Hello André, Friday, July 15, 2005, 4:24:23 PM, you wrote: AM> I am trying to trim some text containing HTML tags. What I want to AM> do is to trim the text without trimming the tags or html entities AM> like   and

Re: [PHP] Trimming Text

2005-07-15 Thread André Medeiros
On Fri, 2005-07-15 at 16:03 +0100, Richard Davey wrote: > Hello André, > > Friday, July 15, 2005, 4:24:23 PM, you wrote: > > AM> I am trying to trim some text containing HTML tags. What I want to > AM> do is to trim the text without trimming the tags or html entities > AM> like   and such, wich c

RE: [PHP] Trimming Text

2005-07-15 Thread tg-php
Sounds like maybe he wants to keep his output to 25 chars not including HTML tags.. but wants to output tags if they're present. Turn this: This is regular text with some text inside a span Into this: This is regular text with some text inside a span Then trim to: This is regular text with The

RE: [PHP] Trimming Text

2005-07-15 Thread André Medeiros
On Fri, 2005-07-15 at 10:02 -0500, Jay Blanchard wrote: > [snip] > Let's say that I have an original string like: > > This is regular text with some text inside a > span > > Let's say I want to trim it to 25 chars. > > "Brainless trimming" would give me something like > > "This is regular text

Re: [PHP] Trimming Text

2005-07-15 Thread André Medeiros
On Fri, 2005-07-15 at 16:12 +0100, Raz wrote: > If you really want to do it, you're gonna have to get your hands > dirty, I'm afraid...;) > > ...off with the gloves...! I was affraid that would happen :( Thanks anyway :) Take care! -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] Trimming Text

2005-07-15 Thread Raz
If you really want to do it, you're gonna have to get your hands dirty, I'm afraid...;) ...off with the gloves...! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Trimming Text

2005-07-15 Thread Richard Davey
Hello André, Friday, July 15, 2005, 4:24:23 PM, you wrote: AM> I am trying to trim some text containing HTML tags. What I want to AM> do is to trim the text without trimming the tags or html entities AM> like   and such, wich completelly break the design. The problem as I see it, is that while i

RE: [PHP] Trimming Text

2005-07-15 Thread Jay Blanchard
[snip] Let's say that I have an original string like: This is regular text with some text inside a span Let's say I want to trim it to 25 chars. "Brainless trimming" would give me something like "This is regular text tag, thus messing the design also. It also happened to trim   to half, havin

Re: [PHP] Trimming Text

2005-07-15 Thread André Medeiros
On Fri, 2005-07-15 at 15:49 +0100, Raz wrote: > Are you trying to turn, for example > > Some text here. > > into > > Some text here. > > ? Let's say that I have an original string like: This is regular text with some text inside a span Let's say I want to trim it to 25 chars. "Brainless t

Re: [PHP] Trimming Text

2005-07-15 Thread Raz
Are you trying to turn, for example Some text here. into Some text here. ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Trimming Text

2005-07-15 Thread André Medeiros
On Fri, 2005-07-15 at 15:40 +0100, Raz wrote: > Take a look at http://uk.php.net/manual/en/ref.pcre.php - plenty of > useful functions for this sort of thing... > > raz Implementing regular expressions on this kind of task would be a big PITA... and that's if it works (read my previous e-mail).

Re: [PHP] Trimming Text

2005-07-15 Thread Raz
Take a look at http://uk.php.net/manual/en/ref.pcre.php - plenty of useful functions for this sort of thing... raz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Trimming Text

2005-07-15 Thread Jay Blanchard
[snip] I am trying to trim some text containing HTML tags. What I want to do is to trim the text without trimming the tags or html entities like   and such, wich completelly break the design. Has anyone succeded on doing such a thing? phpclasses.org won't help :( [/snip] What do you mean, "trim s

[PHP] Trimming Text

2005-07-15 Thread André Medeiros
Greetings. I am trying to trim some text containing HTML tags. What I want to do is to trim the text without trimming the tags or html entities like   and such, wich completelly break the design. Has anyone succeded on doing such a thing? phpclasses.org won't help :( Thanks in advance. André --

Re: [PHP] Trimming text

2002-04-24 Thread Ashley M. Kirchner
Miguel Cruz wrote: > Someone else has already provided you with a regex. I'll provide you with > a new question: Why store it that way? Just create a new field to hold the > name of the user who last modified the description. Then you don't have to > do all that processing, and you aren't unneces

Re: [PHP] Trimming text

2002-04-24 Thread Miguel Cruz
On Wed, 24 Apr 2002, Ashley M. Kirchner wrote: > I have a variable ($description) that contains text data (pulled from an MySQL >DB). I need to delete the last few lines from that data. Prior to the data getting >submitted to the DB (during a different routine), the following information g

[PHP] Trimming text

2002-04-23 Thread Ashley M. Kirchner
I have a variable ($description) that contains text data (pulled from an MySQL DB). I need to delete the last few lines from that data. Prior to the data getting submitted to the DB (during a different routine), the following information gets added: $description .= "\n\n< span class=