PHP Array special value Solution [duplicate]
Possible Duplicate:
PHP compare HTML characters array Solution
I got a value stored in $arrNew[4]
, I want to
check if the value currently stored in $arrNew[4]
is equal to another value.
The problem is, the value in arrNew[4] isn't there most of the times, so i want it as a string so i can use it on other parts.
example $string = "text"
I want "text". The same goes with $arrNew[4]
But if I echo $arrNew[4]
out I get "vrij     "
It isn't the same as in $arrNew[4]
because I can't do $forNew == "vrij     "
it doesn't equal TRUE but $forNew == $arrNew[4]
does.
So how should I get the value stored in $arrNew[4] to a string, without it being changed. (probably cause of special characters?)
How should I do this ?
Any help is appreciated :)
foreach开发者_如何学JAVA ($arrNew as $forNew)
{
$forCount = $forCount + 1 ;
if($forNew == $arrNew[4])
{
echo "Vrij: ".$arrOld[$forCount] ;
}
}
The problem is, the value in arrNew[4] isn't there most of the times,
You should explain why.
so i want it as a string so i can use it on other parts.
Why do you think that not having it as a string will not allow you to use it elseehere, please explain.
But if I echo $arrNew[4] out I get "vrij     "
Echoing a variable and getting   in the browser is sure there is an important piece of information that you don't display, please show it (sounds like something related html specialchar).
It isn't the same as in $arrNew[4] because I can't do $forNew ==
"vrij     " it doesn't equal TRUE but $forNew == $arrNew[4]
It seems that apart from php you have some work to do on expressing your self, describing and presenting a problem in an understoodable way.
So how should I get the value stored in $arrNew[4] to a string, without it being changed.
Just undo whatever you did on storage, I suspect it doesn't get a value assigned in a trvial way but insted through an html specialchar function.
Finally take serious consideration on writing good question, put your self in others position.
精彩评论