echo($menuVal['icon']);
/* if($menuVal['icon'] !== 'fa-dashboard' ){
$menuHTML .= '<span class="ico fa fa-fw fa-chevron-right"></span>';
}*/
$cont=strcmp($menuVal["icon"],"fa-dashboard");
echo($cont);
if((strcmp($menuVal["icon"],"fa-dashboard")) != 0 ){
$menuHTML .= '<span class="ico fa fa-fw fa-chevron-right"></span>';
}
in this code i'm trying to print the icon using php if it value is not equal to fa-dashboard,i think strcmp
will produce an output zero if inputs are equal,but in this code strcmp is producing an output of 243 when both strings are equal and the if
condition is worked when put 243 instead of 0.
i added the output obtained on below,i'm also checked the value of $menuVal['icon']
to check what it prints,
fa-dashboard 243fa-globe 768fa-puzzle-piece 3072fa-pie-chart
3072fa-gears 768fa-anchor -768
is there any error in this code?how can i fix that? any help will get appreciated..........!!!