javascript - Compare strings that have white space on the left side -


hello comparing 2 strings.. how identify both deference/same if 1 having white space like,

a=ashus<br> b=ashus     (second 1 white space on left side) 

now want check whether both values same or not.(according code, both different)

if($qopt1a==$qopt2a or $qopt1a==$qopt3a or $qopt1a==$qopt4a or $qopt2a==$qopt3a or $qopt2a==$qopt4a or $qopt4a==$qopt3a){     echo "<script>             alert('option should not same');           </script>"; } 

what need trim(). it'll remove white space on both sides, if want remove white space in left side can use ltrim()


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -