|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Does anyone know of a way to replace text in web pages, dynamically, before they are returned to the client?
For example, replace all occurances of a company name with a link to that companies page? Ideally, the solution would work with any HTTP text, not just from PHP. Any suggestions? Thanks. |
|
#2
|
|||
|
|||
|
Well you can READ the pages in with a PHP script and the fopen() function. Read it all in into a string and do a ereg_replace("whatever","withsomething",$string) or str_replace() afterwards. This should help ... then you can simply echo $string; and the page is displayed the way u want it.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Dynamically replace text before output |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|