It seems my trim code isn't working properly for other people, but it works perfect for me. I have no idea what's going on, but heres a sample of my code: $added = "false"; $array = split(",", "$addedusers"); foreach($array as $key => $value) { if (trim($value) == $rdr){ $added = "true"; } } Code (markup): This is where it checks a string similar to 5623,765342,657431,998732 for the id $rdr which in this case might be.. 765342 And heres where I check if someone is added or not: if($added=="false"){ // CODE HERE } Code (markup): It seems the trim isn't working properly, when I put something in the code like.. echo trim($value); It doesn't display the trimmed item for the other person, I guess I can call it. But it shows for me. Any ideas? I am getting very frustrated with this.
true and false do not require quotes or double quotes, by using them it will always evaluate to true, because infact you're setting the text "false" which has a numerical value > 1
Well it works good for me, but for others I guess it fails to work. I will post more of the code sometime today when I am not busy.
That still didn't work for the other users, but works fine for me still Would anyone mind looking at my full code (the one php file) and try to figure out what I am doing wrong? The code is pretty messy, I was in a hurry when I made the script. Thanks!
Hey there, I'm new here. Thought I'd shed some different light on things: $rdr = 765342; $values = array('5623','765342','657431','998732'); $added = false; if (in_array($rdr, $values)) { $added = true; } PHP: Regards, Peter
I am trying the if (in_array($rdr, $values)) Code (markup): you entered above, if this works i'll reply here I have to wait until my partner gets on, he's one of the people who it doesn't work for.