Variable not staying set

This is most likely just a PHP problem, and it’s probably a pretty simple answer, but I just can’t seem to get my brain to function this morning. This is what I’m trying to do:

 $job_file = $cfs->get('job_file'); // job_file is a URL

 if ($job_file = NULL) {
     echo "NOT AVAILABLE";
 } else {
     echo '<a href="'. $job_file . '">' . get_the_title() . '</a>';

It will display the URL of the current page instead of the $job_file variable. What am I missing?

1 Answer

Well, this is PHP…

if ($job_file == NULL) {

You might want to compare, and not set, right?

Leave a Comment