MongoDB\BSON\Javascript
PHP Manual

MongoDB\BSON\Javascript::getCode

(mongodb >=1.2.0)

MongoDB\BSON\Javascript::getCodeReturns the Javascript's code

Beschreibung

final public string MongoDB\BSON\Javascript::getCode ( void )

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns the Javascript's code.

Fehler/Exceptions

Beispiele

Beispiel #1 MongoDB\BSON\Javascript::getCode() example

<?php

$js 
= new MongoDB\BSON\Javascript('function foo(bar) { return bar; }');
var_dump($js->getCode());

?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

string(33) "function foo(bar) { return bar; }"

Siehe auch


MongoDB\BSON\Javascript
PHP Manual