V
V
Vasily Petrov2018-02-12 17:00:08
PHP
Vasily Petrov, 2018-02-12 17:00:08

Is the variable lost in the condition? Or what is it?

There is something similar:

global $user_lk;

$a = ... ;

foreach($a as $b){

        $id = ... ;
        $user_id = ... ;
        $author_id = ... ;

        if ( $id != 0 ) { 
          
            if ( $user_id != $author_id ) { 
                // Условие выполняется — true — все работает. $user_id выводится.	 
            } elseif ( $user_id == $user_lk ) { 
                // Здесь же никак не выполняется. Ставил elseif (true) { но $user_id и вообще ничего не выводится }
                $var[] = $link;
            } 

        } elseif ( ... ) { 
           ...
        }    
    
}

What kind of nonsense is this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-02-12
@alexr64

if ( $user_id != $author_id ) is always true? So what do you want from a branch that should run on false?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question