Replacing a part of a message
I am using this in my code:
PHP Code:
bibu said \yhi Now in the menu it looks colored, but I want that if \y or \w or \r, \d contained, removed in the client_print part. Can someone help me with that? |
Re: Replacing a part of a message
Code:
|
Re: Replacing a part of a message
here'sapostwithnowhitespacetocompensatethe previouspost
|
Re: Replacing a part of a message
Quote:
Code:
|
Re: Replacing a part of a message
Works perfectly, thanks exolent. Couldn't understand seta's message, but however. :mrgreen:
|
Re: Replacing a part of a message
Quote:
Also it would be more efficient to not use 2D arrays for such code. Here's my way tho: Code:
|
Re: Replacing a part of a message
I think he was making it easier to review/add/remove the replace-characters if needed, not so much that a 2d array was required; this allows the user to easily add/remove items without touching any of the other code. I don't think the CPU would take a hit using either method, though. Plus IMO his looks a little cleaner, to each his own.
|
Re: Replacing a part of a message
Quote:
|
Re: Replacing a part of a message
Why should I?
|
Re: Replacing a part of a message
replace_all() uses more code and is supposed to be used to avoid infinite replacement, but here it won't happen, so it's fine while + replace. Btw, I agree with Bugsy.
|
| All times are GMT -4. The time now is 11:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.