php question...
- Started
- Last post
- 7 Responses
- gabriel_pc
Any links on how to set up recreate that nifty feature on NT where it makes your typed links live in the PVN?
ie...I would type in h t t p and it would become a live link.
Thanks!
- unfittoprint0
use regular expressions to check the existence of any "http://" within your string, parse it and create the link.
use preg_replace
http://www.php.net/preg_replacesome nice tutorials
http://www.phpbuilder.com/column…
- function820
i was actually trying to work out the same thing within flash, from a loaded XML file, got everything else except this working
- mike0
we actually made several different attempts with regular expressions, but in the end there are just too many different variations of urls that chris ended up making a rather comprehensive string parser to find and apply links.
- rabattski0
what unfit says. use preg_replace. i copied and pasted some code here:
http://www.sckr4bmb.com/dropbox/…
$msg is the entire message. if just checks if there's a href or a mailto and if so it turns that bit into a link (within the entire message).
- rabattski0
duh. "if just checks.." = "it just checks..". i need some coffee fast.
- System-Idle0
function82
parse yr http string from yr xml and apply html fomatting in a html text field in flash
myTextfield.htmlText=""+myHttp...can also intergrate this into large strings
- System-Idle0
oops, lost the html. its the same as you would set a font color tag in html. put this inside "font color tag "+myHttp+"close font tag".
for any " that occur in your string apart from start and end use \ before " ie \" so flash think its an unbroken string.
diificult to explain when you can show the syntax