Page 325 - CITS - CSA - TP (Volume 1) - Hindi
P. 325
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
echo “Pattern found in the string.”;
}
else
{
echo “Pattern not found in the string.”;
}
?>
</body>
</html>
3 ो ाम को C:\Apache24\htdocs म .php ए ट शन वाले फ़ो र म सेव कर
4 Apache सिव स को िवंडोज़ सिव स से रन कर
5 ाउज़र ओपन कर और िन एड ेस टाइप कर
http://localhost/foldername/
6 रन करने के िलए php फ़ाइल पर क कर और आउटपुट को वेरीफाई कर
VI {} का उपयोग करके रपीट िकये जाने वाले करै र को मैच करना (Matching repeating characters using {})
1 टे एिडटर ओपन कर
2 िन कोड िलख
<html >
<head>
<title> Matching repeating characters using {} </title>
</head>
<body>
<?php
$string = “12345”;
$pattern = “/\d{3,5}/”; // Matches 3 to 5 digits
if (preg_match($pattern, $string))
{
echo “The string contains 3 to 5 digits.”;
}
?>
</body>
</html>
309
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 58

