Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php function returning 0?

ok, so i am creating a php login system and wanted a simple way to get the link to the logout page by calling a function but it keeps returning 0. He's my function:

function logout_link() {
include("auth_vars.php"); //This file contains $auth_path_login
return $auth_path_login+"?status=loggedout";}

and this is how i am using it:

<a href="<?php echo logout_link();?>">logout</a>

However it keeps producing:

<a href="0">logout</a>

What is going wrong ?

like image 327
luke Avatar asked Feb 18 '12 17:02

luke


1 Answers

The operator for string concatenation is ., not +.

See http://www.php.net/manual/en/language.operators.string.php

like image 155
The Nail Avatar answered Oct 05 '22 22:10

The Nail