I have a million and if foreach in scripts from before, but this one I can not seem to know. It just is not working ...? Perhaps this is one of those things, if you look at it 100 times you will not see the error and the second set of eyes will be required. Ok, so here's the code:
The personal function can be removed by resultUUID {foreach ($ this-> search result as $ key => $ value } {If (! $ $- [$ [- key]) Search [Reset [$ of] ['authorUID'] == $ this- & gt; Search UID); } Return; } Simply put, this forum is a part of the search program, which attempts to remove search results based on the username that they can filter. The problem is, this is not filtering, so I went to the examination mode and adjusted the code to see what was happening:
remove the private functionBuyBug () {foreach ($ this - & gt; searchResults $ key = & gt; as $ value) {var_dump ($ this-> Search [result] [$ key] ['authorUID']); Echo ''; Var_dump ($ this-> searchUID); Echo & lt; Br / & gt; '; If (! $ This-> Search [Result [$ of] [[authorUID '] == $ this-> Search UID) {echo "This is not a match"; Not set ($ this-> search results [$ key]); }} Die (); Return; } Okay, then there is an easy way to check, dump the variable if to see if their value is set (to ensure echo use instead of varo_dump My knowledge is that they are both string types Then I add an echo to see if the condition is triggered when the condition is triggered. Then kill the script to see the result. I tossed some search criteria with a username, the program changes into a user based on DD in user ID, each result that gets caught by the search that adds the author's user ID to the array of results in matches. What I found here:
string (1) "3" string (1) "3" string (1) "1" string (1) "3" string (1) "1 "String" (1) "3" string (1) "1" string (1) "3" It seems that there is never a trigger, though the dump variable It seems that it should be a trigger for the last 3 iterations. I've seen it for an hour what did I do wrong? I'm going to kick myself for a stupid mistake. Thank you for any help!
You < Code>! = ! $ X == $ y :
if ($ - this-> search [result] [$ Of] ['authorUID']! = $ This-> Search UID) // //: (if ($ ($ ($ $ -> [$ key] ['authorUID']] == $ this- & gt; Search UID)} {// your code here} ! $ $-> search [result [$ key] ['authorUID'] or Then there will be true or wrong (most likely false , unless you have no ID of "0" Is). So your comparison false == $ this-> Search UID changes to . There is no possibility of a match.
Comments
Post a Comment