Created
April 26, 2019 14:37
-
-
Save jbd91/1171f7642a86f6d9d78e13fd549500bb to your computer and use it in GitHub Desktop.
Detect if http(s) protocl is declared in string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (!preg_match('#^https?://#', $qnbv_tdl_website)) : ?> | |
<p><a href="//<?php echo $qnbv_tdl_website; ?>" | |
target="_blank"><?php echo $qnbv_tdl_website; ?></a></p> | |
<?php else : ?> | |
<p><a href="<?php echo $qnbv_tdl_website; ?>" | |
target="_blank"><?php echo $qnbv_tdl_website; ?></a></p> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment