Jump to content

Archived

This topic is now archived and is closed to further replies.

rem

Erase chars from a string @ a given point ...

Recommended Posts

Hi everybody,

How can I erase all chars in a string after a given point (like / , <>, or . ) ?
ex: This is an example ... I need everything erased after the three points

Thanks a lot, any help would be very appreciated!

Regards,
Rem.

Share this post


Link to post
Share on other sites
Use a combination of substr and strpos:

[a href=\"http://www.php.net/substr\" target=\"_blank\"]http://www.php.net/substr[/a]
[a href=\"http://www.php.net/strpos\" target=\"_blank\"]http://www.php.net/strpos[/a]

Share this post


Link to post
Share on other sites
[!--quoteo(post=384042:date=Jun 14 2006, 07:34 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 14 2006, 07:34 PM) [snapback]384042[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Use a combination of substr and strpos:

[a href=\"http://www.php.net/substr\" target=\"_blank\"]http://www.php.net/substr[/a]
[a href=\"http://www.php.net/strpos\" target=\"_blank\"]http://www.php.net/strpos[/a]
[/quote]


Thanks a lot for the tip :)
I'll surelly look into that!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.