Page 1 of 1

HTML replace

Posted: Tue Jul 20, 2010 11:51 am
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 />";

Re: HTML replace

Posted: Tue Jul 20, 2010 8:28 pm
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.