Jump to content

trying to figure something out


desjardins2010

Recommended Posts

guys is it possible to somehow compare something like these two together and make a choice depending on the out come

 

SystemKeyv1.0 and PasswordCrackerv2.0

 

PasswordCrackerv2.0 is grater than SystemKeyv1.0 can these be compared somehow?

 

thank for advise guys;

 

Cheers

 

Link to comment
https://forums.phpfreaks.com/topic/222323-trying-to-figure-something-out/
Share on other sites

BlueSky I was trying to message you but for some reaso it wasn't working.. after I get the two last three digits? how can I compare them if ($lastthree > $otherthree)? the passwordcrackerv1.0 is a txt field in the database? does that not make what I'm comparing non numeric

for anyone else who might be looking at this and have a solution please do

 

using this it spits out the 2.0 and 1.0 how can I say if one is higher or equal to the other do something else do something else.. problem I see is that when I rip these off the end of the program name thats in the db as a text field..

<?php
$passwordcracker = "PasswordcrackerV2.0";
$systemkey = "1.0";

$lastthree = substr($passwordcracker, -3);

echo $lastthree."<br />";

echo $systemkey;
?>

 

any ideas

thanks

doesn't matter if they are text. '2.3' is still greater than '1.0'

 

$var1 = '1.0';
$var2 = '2.3';

if ($var1 > $var2) {
     echo "var1 is a higher value";
} else if ($var1 < $var2) {
     echo "var2 is a higher value";
} else {
     echo "both vars are the same";
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.