image path replacement with php
Posted: Mon Aug 21, 2006 3:23 am
feyd | Please use
Is it possible to use php to:
read this file in, then replace the ../../ with mypath so the two images will look like <img src="mypath/logo.jpg"></img> and <img src="mypath/header.jpg"></img> while other code remains the same?
Are there any php scripts doing this type of task or anyone would help?
With my best,
Jim
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi All,
Currently I have a file named test.html it looks like this:
[syntax="html"] <html>
<head>
</head>
<body>
<table>
<tr>
<td>
<img src="../../logo.jpg"></img>
</td>
<td>
<img src="../../header.jpg"></img>
</td>
</tr>
</table>
</body>
</html>read this file in, then replace the ../../ with mypath so the two images will look like <img src="mypath/logo.jpg"></img> and <img src="mypath/header.jpg"></img> while other code remains the same?
Are there any php scripts doing this type of task or anyone would help?
With my best,
Jim
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]