Access Classes & Files from Folder

I hope this is not a dumb question. I have a .Net API and I want to make calls to it via PHP. I’ve grabs the c# version of the Classes in a text file. I plan on creating a bunch of files in a folder called “wbg”. So If I have class “abc” inside folder “wbg” and the file is named “abc.php”. What would my code look like when I reference the class?

`<?php $abc = new wbg->abc();?>`

It depends on your autoloading config. I suggest you just use composer and psr-4
https://thewebtier.com/php/psr4-autoloading-php-files-using-composer/

I’m curious what the overall goal of this is?

Calling an API to do this is far from normal and there are very likely a better suited alternative, but I need to know what you are trying to actually do, not how you are trying to do it.

Goal will be to create the object in PHP and convert it to JSON, make the call to my API and return data as JSON and convert it to the Object.

Sponsor our Newsletter | Privacy Policy | Terms of Service