When I use this code, I am getting output as followsPHP Code:<html>
<head>
</head>
<body>
2) Create a string, search for a word in that string. If the word is found display word found. If not found display a message saying word not found.<br />
<?php
$subject = "I learn web development ";
$pattern = '/web/'; // I have also tried /^web$/ and /^web/
preg_match($pattern, $subject, $matches);
echo $matches[0];
?></body>
</html
ss
2) Create a string, search for a word in that string. If the word is found display word found. If not found display a message saying word not found.
Array
Please suggest whats wrong and why am I not getting output as "web"
Thanks
