我怎么能这样做PHP If Statement是否正确?

I have 50 variables in php. I want to check each of them and if they true then add 2 points in a variable called $point. I am new so I write a few lines but I think I am doing wrong way.

$strenght_point = 0;

if($f_name){$strenght_point++;} 
if($l_name){$strenght_point + 2;}   
if($full_name){$strenght_point + 2;}    

How can I do it right way.Thanks

Update my full function is here... It's Codeigniter Controller Function Hope you guys understand well now

function strength_scale() {

        $user_id = $this->uri->segment(2);
        $user_name = $this->uri->segment(3);


            $query = $this->db->get_where('aoa_user', array('id' => $user_id, 'username' => $user_name));       
            foreach ($query->result() as $row){ 

                $f_name = $row->f_name;             
                $l_name = $row->l_name;             
                $full_name = $row->full_name;               
                $username = $row->username;             
                $alias_name = $row->alias_name;             
                $gender = $row->gender;             
                $country = $row->country;               
                $avatar = $row->avatar;             
                $cover_photo = $row->cover_photo;   
                $email = $row->email;   
                $skill = $row->skill;   
                $other_skills = $row->other_skills; 
                $ex_time = $row->ex_time;   
                $about = $row->about;   
                $company = $row->company;   
                $company_position = $row->company_position; 
                $phone = $row->phone;   
                $facebook = $row->facebook; 
                $facebook_page = $row->facebook_page;   
                $google_plus = $row->google_plus;   
                $twitter = $row->twitter;   
                $youtube = $row->youtube;   
                $skype = $row->skype;   
                $linkedin = $row->linkedin;                     
                $website = $row->website;   
                $latitude = $row->latitude; 
                $longitude = $row->longitude;   
                $verification = $row->verification; 

            }

        $strength_point = 0;

        if($f_name){$strength_point++;} 
        if($l_name){$strength_point + 2;}   
        if($full_name){$strength_point + 2;}    
}

Create an array with the variables instead.

https://3v4l.org/FYTtG

$arr = array("f_name" => true, "l_name" => true, "full_name" => true);

$strength=0;

Foreach($arr as $var){
   if($var) $strength = $strength+2;
}

Echo $strength;

As Rizier123 said, you need to increment your strength variable correcly. You could write a simple function that would accept one of your 50 variables and return the strength increment:

function defineStrength($param)
{
    if ($param) {
        return 2;
    }
    return 0;
}

$strength = 0;

$f_name = true;
$l_name = false;
$full_name = false;

$strength += defineStrength($f_name);
$strength += defineStrength($l_name);
$strength += defineStrength($full_name);

However, an array would be a better way to go, as Andreas mentionned.

In your question update you said you use CodeIgniter. As the documentation states you can return the query result as a pure array. So you could further develop like that :

function defineStrengthFromArray(array $row)
{
    $strength = 0;
    foreach ($row as $param) {
        $strength += defineStrength($param);
    }
    return $strength;
}

foreach ($query->result_array() as $row){

    $strength = defineStrengthFromArray($row);

}