Snippets tagged “preg-match”
8 snippets use this tag.
- How to add http:// if it doesn't exist in the URLPHP
You can use the following code snippet to add "http://" to the beginning of a URL if it doesn't already exist:
- How to Detect Browser with PHPPHP
Browser detection is used to determine the web browser a visitor is using and to serve browser-appropriate content to the visitor. Know how to do it with PHP.
- How to search text using php if ($text contains "World")PHP
You can use the strpos() function in PHP to search for a specific string within another string.
- How to Validate an Email with PHPPHP
This tutorial explains how to validate an email using the PHP arsenal. Check out the examples of how to do that with the help of a PHP function and regex.
- How to Validate URL with PHPPHP
In this snippet, we provide guidelines on one of the most common issues in PHP. Here, we show the most straightforward way on how to validate URL with PHP.
- PHP Regex to get youtube video ID?PHP
You can use the following regular expression to extract the YouTube video ID from a URL:
- PHP: Best way to extract text within parenthesis?PHP
There are a few different ways to extract text within parentheses in PHP, depending on the specific requirements of your use case.
- PHP/regex: How to get the string value of HTML tag?PHP
In PHP, you can use the preg_match() function to extract the string value of an HTML tag.