Benim HTML formu:
<form action="http://localhost/wordpress" id="search" method="get">
<input type="text" size="30" id="s" name="s" value="Type and hit enter" onfocus="javascript:this.value='';" onblur="javascript:this.value='Type and hit enter';"/>
<br/>
<input type="submit" value="Search"/>
</form>
Benim PHP komut dosyası:
<div class="message">
You searched for:
<?php
$searchterms = explode(" ", $_GET["s"]);
foreach ($searchterms as $searchterm) {
$length = strlen($searchterm);
$searchterm = substr($searchterm, 0, $length-1); ?>
<span class="searchterm"><?php echo $searchterm." "; ?></span>
<?php } ?>
</div>
Bu son alfabesini keser VE>