NameSilo

[Resolved] What is the logic of this PHP code?

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

theSun

Account Closed (Requested)
Impact
907
Solved.

Solved.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Looks like a line of code from a webbased (SIM) game.
If you can tell me what the $row and the $r arrays stand for, I can give you a more semantic explanation. Until now if we reformat the code this is what you get:



PHP:
if  (
        $row['level']<=$r['level'] 
        && 
        (
            (
                $row['people'] > 0 
                &&
                ($row['people']+1) <= $r['grp']
            ) 
           || 
            $row['people'] == 0
        )
    ) 		
{ 		
    echo '<div align="left" id="details">           <div align="right"><a href="build_base.php?id='.$row['id'].'">Build base.</a></div>

   ...

So it says: "Print a link to 'Build Base' under the condition that:

- 'level' from $row is smaller than or equal to 'level' from some array $r
AND
- either (the value for 'people' from some array $row is bigger than 0 but smaller than the value for 'people' from some array $r) or the value of 'people' for some array $row equals 0.
 
0
•••
Why do you need the logic of the code. I don't Think you will use such kind of code in your website or somewhere else. And You can run the code to check the logic anyway!
 
0
•••
Fladry said:
Why do you need the logic of the code. I don't Think you will use such kind of code in your website or somewhere else. And You can run the code to check the logic anyway!

Why are you a human? Your comments are not helpful at all. Zero help. Least expected from you. However, mvl solved it. I asked a question, and you give garbage comment, waste people time.
 
0
•••
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Parking: find your domains by pasting a list
You can now paste a list of domain names into the search box at the top of the Parking menu. Put one name on each line. Your domain list...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back