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

Declares the variables in inside of PHP.

<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.SetVariable"; VariableName; TextValue ) 

**MBS**( **"PHP.SetVariable";** /\* Declares the variables in inside of PHP. \*/  
**$VariableName**; /\* the name of the variable \*/   
**$TextValue**) /\* the value of the variable \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| VariableName | the name of the variable |  |
| TextValue | the value of the variable |  |

### Result

Returns OK on success.

### Description

Declares the variables in inside of PHP.   
This is one way to get data into php from FileMaker.  
### Examples

Set varibale and output it:

Set Variable \[ $result ; Value: MBS( "PHP.SetVariable"; "c"; 5 ) \]   
Set Variable \[ $result ; Value: MBS("[PHP.Run](PHPRun.md)"; "echo $c;") \]   
Set Field \[ Simple\_php::result ; MBS("[PHP.GetResultString](PHPGetResultString.md)") \]

### See also

- [OCR.GetVariable](OCRGetVariable.md)
- [OCR.SetVariable](OCRSetVariable.md)
- [PHP.GetResultString](PHPGetResultString.md)
- [PHP.GetVariable](PHPGetVariable.md)
- [PHP.Run](PHPRun.md)
- [XML.SetVariables](XMLSetVariables.md)

### Blog Entries

- [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

  
[PHP.Run](PHPRun.md) - [PHP.ShutDown](PHPShutDown.md)

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

[HTML Version](PHPSetVariable.shtml)