1

I am trying to work out how to call a function from an external PHP file.

So far I have this:

<?php

include("http://www.website.net/wp-content/plugins/monarch/monarch.php");

display_inline();

?>

The function display_inline(); returns a string of HTML/CSS.

Just need to know if you think the syntax is correct?

ham-sandwich
  • 3,975
  • 10
  • 34
  • 46
rainwilds
  • 31
  • 3

1 Answers1

1

Yes that syntax is correct, however if you are making the request to that external file, it's going to return whatever the output of the executed monarch.php file was. If the file is local you'll have access to the functions. Unlike how HTML includes a CSS file, on the local system the path used by PHP should be relative to the system and not the webroot. You shouldn't need to be cautious about this so go ahead and try it.

J-Dizzle
  • 3,176
  • 6
  • 31
  • 49