Jump to content

Concatenate in function parameter allowed?


chrisMartin

Recommended Posts

Is anything like this allowed:

 

<?php

if(file_exists("func1(parameter).'/images/'.func2(parameter)")) {

// do some stuff

      }

?>

 

I'm trying to use a few Wordpress directory/path functions in a template file and want to check for the existence of a particular file and if it exists, to do a few things...but can't get the syntax right. Maybe not possible like this?

It should work if the syntax was correct, try this:

 

 if(file_exists(func1(parameter).'/images/'.func2(parameter))) {

 

As long as the functions return a string, I can see no reason for that not to work, unless I am mistaken.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.