HTML replace

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pedroz
Forum Commoner
Posts: 99
Joined: Thu Nov 03, 2005 6:21 am

HTML replace

Post by pedroz »

$stringA = "<input type='text' class='text urlfield' name='attachments[1004][url]' value='http://www.domain.com/URL' /><br /> <button type='button' class='button urlnone' title=''>None</button> <button type='button' class='button urlfile' title='http://www.domain.com/URLa'>URL do ficheiro</button> <button type='button' class='button urlpost' title='http://www.domain.com/URLb'>URL do Post</button>";

$stringB = "<input type='text' class='text urlfield' readonly='readonly' name='attachments[1004][url]' value='http://www.domain.com/URL' /><br />";


How can I get http://www.domain.com/URLa from $stringA and change for the following?
http://www.domain.com/URLa is random, so it must be grabbed from $stringA ... class='button urlfile' title='http://www.domain.com/URLa'

$stringA = "<input type='text' class='text urlfield' name='attachments[1004][url]' value='http://www.domain.com/URLa' /><br /> <button type='button' class='button urlnone' title=''>None</button> <button type='button' class='button urlfile' title='http://www.domain.com/URLa'>URL do ficheiro</button> <button type='button' class='button urlpost' title='http://www.domain.com/URLb'>URL do Post</button>";


$stingB = "<input type='text' class='text urlfield' readonly='readonly' name='attachments[1004][url]' value='http://www.domain.com/URLa' /><br />";
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: HTML replace

Post by yacahuma »

I dont know if I understand your question but if "http://www.domain.com/URLa" is random and you need it in 2 places, just create a variable.
Post Reply