Page 332 - CITS - CSA - TP (Volume 1) - Hindi
P. 332
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
IV x (ए ट डेड) मॉिडफायर (x (extended) modifier)
1 टे एिडटर ओपन कर
2 िन िल खत कोड िलख
<html >
<head>
<title> x (extended) modifier </title>
</head>
<body>
<?php
$pattern = “
/
^ # Start of the string
\d{3} # Match exactly 3 digits
- # Match a hyphen
\d{4} # Match exactly 4 digits
$ # End of the string
/x
“;
$string = “123-4567”;
if (preg_match($pattern, $string)) {
echo “Match found!- extended modifier”;
“;
} else {
echo “No match found!”;
}
// Output: Match found!
?>
</body>
</html>
3 ो ाम को C:\Apache24\htdocs म .php ए ट शन वाले फ़ो र म सेव कर
4 िवंडोज़ सिव स से Apache सिव स रन कर
5 ाउज़र ओपन कर और िन एड ेस टाइप कर
http://localhost/foldername/
6 रन करने के िलए php फ़ाइल पर क कर और आउटपुट वेरीफाई कर
316
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 58

