When I fetch data from my database to my php. I get and when I check it's source it looks something like this:
<li class="ui-state-default"><input type="checkbox" id="check1" class="chk" name="countryname[]" value="AF
" > AFGHANISTAN`
in the value field you can see there is space after AF. Now the problem which occurs here is that these space are not in database and i want to skip these spaces and this is not even in my php code. Well they could be in my database but I want to skip them or delete them from database.
Here is my code
<ul id="sortable"> <? while($row = mysql_fetch_array($result)) { ?> <li class="ui-state-default"><input type="checkbox" id="check1" class="chk" name="countryname[]" value="<?echo urldecode($row['Code']);?>" <? $reflex = mysql_query("select distinct * from geocity where isAllowed='1' AND country='" . $row['Code'] . "'"); $count = mysql_num_rows($reflex); if ($count == 0){echo '';}else{echo 'checked';} ?>> <? echo $row['CountryName']; ?> </li> <? }; ?>
echo "$country['code'] ";in your php. with a space, i mean.