Page 324 - CITS - CSA - TP (Volume 1) - Hindi
P. 324
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
<?php
$string = “cat”;
$pattern = “/c.t/”;
if (preg_match($pattern, $string))
{
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 फ़ाइल पर क कर और आउटपुट को वेरीफाई कर
V ‘\d का उपयोग करके िकसी भी अंक को मैच करना (Matching any digit using ‘\d )
1 टे एिडटर ओपन कर
2 िन कोड िलख
<html >
<head>
<title> Matching any digit using ‘\d </title>
</head>
<body>
<?php
$string = “abc123xyz”;
$pattern = “/\d/”;
if (preg_match($pattern, $string))
{
308
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 58

