खोज करना पदोंहमारे डिस्कवर पेज पर मनोरम सामग्री और विविध दृष्टिकोणों का अन्वेषण करें। नए विचारों को उजागर करें और सार्थक बातचीत में संलग्न हों
طريقة انشاء نظام بحث عن كلامات بستخدام php , ابسط طريقة ممكنه !
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
$text = "
The php language is the most popular and easy-to-use language,
with 78% of sites using it in some way!
<br>
Python also ranks first in terms of usage, being easy and safer!";
echo $text;
?>
<hr>
<form action="" method="post">
<input type="text" name="word_s" placeholder="Search The word">
<button type="submit" name="search">Search</button>
</form>
<hr>
<?php
if(isset($_POST['search'])){
$programming_we_search_for = $_POST['word_s'];
$delet_space = str_ireplace(" ", "", $programming_we_search_for);
$explode_text = explode(" ", $text);
$search = array_search($delet_space,$explode_text);
if($search == true){
echo "($programming_we_search_for) was mentioned !";
}else {
echo "$programming_we_search_for Not mentioned !";
}
}
?>
</body>
</html>