Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
if statement returns false when values are outputting the same

I am trying to compare a row returned by mysql and whats extracted in my code however it keeps returning false when strlen returns the same and they output the exact same.

if(trim($checkComplete['WorkOrder']) == trim($wo)) {
    //Do nothing
} else {
    //WorkOrder does not match
    echo "WorkOrder does not match!<br>".$wo." | ". $checkCompleteAssoc['WorkOrder']."<br>";
    echo strlen($wo)."<br>";
    echo strlen($checkCompleteAssoc['WorkOrder'])."<br>";

Output:

WorkOrder does not match!
39809337 | 39809337
8
8
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I think you using wrong variable $checkComplete

if(trim($checkCompleteAssoc['WorkOrder']) == trim($wo)) {
    //Do nothing
} else {
    //WorkOrder does not match
    echo "WorkOrder does not match!<br>".$wo." | ". $checkCompleteAssoc['WorkOrder']."<br>";
    echo strlen($wo)."<br>";
    echo strlen($checkCompleteAssoc['WorkOrder'])."<br>";
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!