|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
replace text within a string?
Hello:
Could someone please tell me if it is possible to replace "www.mysite.com" with something like "***" or whatever in a string? example: $string = "Hello all, please visit my site at www.mysite.com!n"; so it says: $string = "Hello all, please visit my site at ***!n"; Any ideas? Thanks in advance! |
|
#2
|
|||
|
|||
|
RE: replace text within a string?
I am thinking you are wanting to replace any url? in that case use something like:
$string = eregi_replace( "(http|https|ftp)://([[:alnum:]+-=%&:_.~?]+[#[:alnum:]+]*)", "***", $string); |
|
#3
|
|||
|
|||
|
RE: replace text within a string?
Hi Matt:
Thanks for the reply! That works great if they have the "http://" but what if the went like "www.mysite.com" or even "mysite.com"? Is there anyway to get around that? |
|
#4
|
|||
|
|||
|
RE: replace text within a string?
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > replace text within a string? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|