FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Syntax for trim charlist?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Syntax for trim charlist? [message #171935] Fri, 21 January 2011 23:35 Go to previous message
GarryJones is currently offline  GarryJones
Messages: 21
Registered: September 2010
Karma:
Junior Member
I need to trim away * and # in a list of names.

First I want to get rid of the standard funny stuff so I do this.

$mytrim1 = trim($mytext);

Now I need to remove all the * and the # and this is where I am stuck.

The syntax on php.net says to use "string trim ( string $str [, string
$charlist ] )"

As in $mytrim2 = trim($mytrim2, $charlist);

Countless complex examples are given but nowhere I can find an
explantion of how to write $charlist - I just need to trim all the *
and the # from this list of names.

So bottom line, how do I set $charlist to just omit the * and the #

Can these characters be added to the first "standard" trim to cut the
code down to one row?

And question 2. Is there a "php made simple" website. I just wanted a
simple standard explanation. I find I am always looking at massive
complex solutions in the examples on php.net. All very useful I am
sure but I need to learn to walk before I can run.

Any help greatly appreciated.

Garry Jones
Sweden
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Implement Php performace
Next Topic: Is there any situation where anything other than require_once is better?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 08:39:45 GMT 2024

Total time taken to generate the page: 0.06043 seconds