Detect link type

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 8, 2011   (RSS)

Hi Guys.

I have a text field "link" where users will enter an absolute or relative URL. ie. /about.php or http://www.google.com

Is there a way that I can say;

<?php if ($record['link'] starts with "http://): ?> ...this code
<?php elseif ($record['link'] starts with "www): ?> ...this code
<?php else: ?> ...this code

it could also be used for file types... ie. contains .PDF etc
Cheers,

Tim (toledoh.com.au)

Re: [robin] Detect link type

Thanks Robin!
Cheers,

Tim (toledoh.com.au)