<title>Monkeybread Software - MBS FileMaker Plugin: PHP.Execute</title></head><body>PHP.Execute
-----------

Executes the specified php code and returns the text output.

<style>
td.grau 
{
background-color:#EEE;
text-align: center;
}
</style>| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PHP](component_PHP.md) | [2.9](newinversion29.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "PHP.Execute"; phpCode ) 

**MBS**( **"PHP.Execute";** /\* Executes the specified php code and returns the text output. \*/  
**$phpCode**) /\* the source code of the script you are executinge.g. $code \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| phpCode | the source code of the script you are executing | $code |

### Result

The string returned from the PHP function or error message.

### Description

Executes the specified php code and returns the text output.  
Same as calling [PHP.Run](PHPRun.md) and [PHP.GetResultString](PHPGetResultString.md), but returns the result directly.  
### Examples

Run test code and get result:

$r = MBS( "PHP.Execute"; "echo 'ok';" )

### See also

- [PHP.GetResultContainer](PHPGetResultContainer.md)
- [PHP.GetResultString](PHPGetResultString.md)
- [PHP.Run](PHPRun.md)
- [SQL.Execute](SQLExecute.md)
- [SSH.Execute](SSHExecute.md)

### Release notes

- **Version 8.1**
    - Changed [PHP.Run](http://www.mbsplugins.eu/PHPRun.shtml) and [PHP.Execute](http://www.mbsplugins.eu/PHPExecute.shtml) to return better error messages.

### Blog Entries

- [MBS FileMaker Plugin, version 8.1pr2](https://www.mbsplugins.de/archive/2018-02-07/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [The Status of our PHP support](https://www.mbsplugins.de/archive/2018-02-03/The_Status_of_our_PHP_support/monkeybreadsoftware_blog_filemaker)
- [PHP Functions in MBS Filemaker Plugin](https://www.mbsplugins.de/archive/2012-10-21/PHP_Functions_in_MBS_Filemaker/monkeybreadsoftware_blog_filemaker)

This function checks for a paid license.

Created 18th August 2014 , last changed 23th January 2023

  
[PDFKit.isLocked](PDFKitisLocked.md) - [PHP.ExistsVariable](PHPExistsVariable.md)

💬 [Ask a question or report a problem](https://www.monkeybreadsoftware.com/feedback/?what=filemaker&path=PHP.Execute)

[HTML Version](PHPExecute.shtml)