Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8059601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:43:25+00:00 2026-06-05T09:43:25+00:00

So when I try the following: $a = ‘1.00’; $b = ‘1.01’; if($a <

  • 0

So when I try the following:

$a = '1.00';
$b = '1.01';

if($a < $b){
    print 'ok';
}

This works fine. But when I retrieve these variables from an xml file. the strings are EXACTLY the same, but for some reason, the if function doesn’t work right. So I assume I have to convert the strings to a number. But when I do so, the decimals get removed.

Is my assumption correct? If so, how do i solve it?

If not, what’s the problem?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:43:26+00:00Added an answer on June 5, 2026 at 9:43 am
    $a = (float) $a;
    $b = (float) $b;
    

    Related reading: http://php.net/manual/en/language.types.type-juggling.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to create image from BLOB. I try following code but it is
I try the following code, but it doesn't work. [helloToolbar setBackgroundColor:[UIColor clearColor]];
If I try executing the following code f = file('test','rb') fout = file('test.out','wb') for
Mime-types are specified in Tomcat's conf/web.xml file. It's look like this: <mime-mapping> <extension>txt</extension> <mime-type>text/plain</mime-type>
I have a table-value function that works correctly if I try the following query:
I try to store a video file into database using MySQL, But i don't
I try as following jquery code, but it doesn't work true, how can fix
Please try the following in Firefox (my version: 3.6.12). This was working and now
This is my replace method in java but unble to replace for following. It
when I try the following it doesn't work: str.replace(| stuff, ) But if I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.