“PHP PREG_MATCH” Code-Antworten

Finden Sie Substring Regx PHP

if (preg_match("/\bweb\b/i", "PHP is the web scripting language of choice.")) {
    echo "A match was found.";
} else {
    echo "A match was not found.";
}
Powerful Puffin

PREG_MATCH IN PHP

<?php
$my_email = "[email protected]";
if (preg_match("/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/", $my_email)) {
echo "$my_email is a valid email address";
}
else
{
  echo "$my_email is NOT a valid email address";
}
?>
Dev

preg_match

if(!preg_match('/^\[a-zA-Z]+$/',$input)) {
   // String contains not allowed characters ...
}
Nighter

PHP PREG_MATCH

<?php
$subject = "abcdef";
$pattern = '/^def/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
?>
Masoud Fesahat

PREG_MATCH IN PHP

<?php
$my_url = "www.guru99.com";
if (preg_match("/guru/", $my_url))
{
	echo "the url $my_url contains guru";
}
else
{
	echo "the url $my_url does not contain guru";
}
?>
Dev

PHP PREG_MATCH

preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] ) : int
Seanzo

Ähnliche Antworten wie “PHP PREG_MATCH”

Fragen ähnlich wie “PHP PREG_MATCH”

Weitere verwandte Antworten zu “PHP PREG_MATCH” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen