Skip to content
WJunction - Webmaster Forum

Auto replacing

Status
Not open for further replies.
Hi, I'm fetching post from RSS and in all posts are download button images. so every post have this

<a href="http://filehost.com/filepath/xxx" ><img src="http://downloadbutton.com/xxx.jpg" border="0" /></a>

Is it possible somehow write some code which will change all links to that download button image so I could use my own download button image? Thank you for help :)
 

2 comments

use this php code
Code:
[SIZE=2][COLOR=#ff0000]<?php
[/COLOR][COLOR=#0000cd]$var1[/COLOR][COLOR=#000000]  = '<a href="http://filehost.com/filepath/xxx" ><img  src="http://downloadbutton.com/xxx.jpg" border="0" /></a>';
[/COLOR]echo str_replace[COLOR=#000000]("http://downloadbutton.com/xxx.jpg","http_direct_link_of_new_image",[/COLOR][COLOR=#0000cd][SIZE=2]$var1[/SIZE][/COLOR][COLOR=#000000]);[/COLOR][COLOR=#ff0000]
?>[/COLOR][/SIZE]

also can be done by regex
 
Last edited:
Status
Not open for further replies.

About the author

B
Active Member · Joined
66
Messages
7
Reactions
8
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom