php - Call method in external class -


how reference method inside external php file?

external-file.php

class ourexternalclient {     public function getsomedata($variable) {       $somecode = new code();       $somecode->variable = $variable;       [...]     } } 

current-file.php

include_once("external-file.php");  $morecode = ourexternalclient::getsomedata($variable); 

...i figure how access external method, i'm not sure. when that, afterwards breaks. example quite vague, i'm hoping can point in right direction.

how creating instance of class?

include_once("external-file.php");  $ourexternalclient = new ourexternalclient();  $morecode = $ourexternalclient->getsomedata($variable); 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -