طريقة انشاء نظام بحث عن كلامات بستخدام 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>
صفحة المبرمجين الرسمية , تشمل حرية نشر الاعمال البرمجية للاخرين , دون الترويج الى روابط خارجية ,
Ali Saeed
Ta bort kommentar
Är du säker på att du vill ta bort den här kommentaren?
mahmoud 3dnan
Ta bort kommentar
Är du säker på att du vill ta bort den här kommentaren?
mohamed reda
Ta bort kommentar
Är du säker på att du vill ta bort den här kommentaren?