Just a simple API PHP library with basic functions and config.

Overview

Installation

  1. Clone this Repository in your PHP Project
git clone https://github.com/maximilianosinski/simple-api-php-library.git
  1. Change your Project name (The name of your Project's Directory [not the full path]) and your Domain.
  2. Include "lib/config.php" in every PHP file you have, where you wan't to use the functions:
include "lib/config.php";

Features

  • Can make HTTP/S responses with custom parameters.
  • Can make HTTP/S requests (GET, POST and more).
  • Lightweight functions for the server's file system.
  • Can translate text to almost any language. Once with specified target language country code and an automatic country code detection of the request/user.
  • Can return information of the request/user (IP, UserAgent, IP GeoLocation).

Simple API PHP Library

Classes

  • Responses
  • Requests
  • FileSystem
  • Typography
  • User

Examples

User

Getting a Users IP Address.

<?php
$IP = User::IP();
?>

Getting the Users IP GeoLocation.

<?php
$GetIPGeoLocation = User::IPGeoLocation();
if($GetIPGeoLocation[0]){
   $Country = $GetIPGeoLocation["country"];
   echo "Users country: $Country";
}
?>

Typography

Translating a custom Text.

<?php
$Translate = Typography::Translate("How are you doing?", "de");
if($Translate["success"]){
	$TranslatedText = $Translate["data"];
	echo $TranslatedText;
}
?>

How-To: Handle Errors

Example

<?php
$Translate = Typography::Translate("How are you doing?", "de");
if($Translate["success"]){
	$TranslatedText = $Translate["data"];
	echo $TranslatedText;
} else {return $Translate;}
?>

How-To: Give back a Response

Example

<?php
$Translate = Typography::Translate("How are you doing?", "de");
if($Translate["success"]){
	$TranslatedText = $Translate["data"];
	Responses::ResponseByReturn($Translate);
} else {Responses::ResponseByReturn($Translate);}
?>
You might also like...
BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

PHP library for the Stripe API.

Stripe PHP bindings The Stripe PHP library provides convenient access to the Stripe API from applications written in the PHP language. It includes a p

A PHP library for the Campaign Monitor API

createsend A PHP library which implements the complete functionality of the Campaign Monitor API. Installation Composer If you use Composer, you can r

PHP 5.3+ library which helps you to interact with the DigitalOcean API

DigitalOcean The version 2 of the API will be available soon ! Please visit DigitalOceanV2 and contribute :) This PHP 5.3+ library helps you to intera

PHP library for the GitHub API v3

GitHub API v3 - PHP Library Currently under construction. Overview Provides access to GitHub API v3 via an Object Oriented PHP library. The goal of th

PHP library for the ArvanCloud API

PHP ArvanCloud API PHP library for the ArvanCloud API. This package supports PHP 7.3+. For Laravel integration you can use mohammadv184/arvancloud-lar

A library written in PHP to interact with Coinbase Pro via API.

A library written in PHP to interact with Coinbase Pro via API.

Upload Vimeo video with CodeIgniter, Official PHP library for the Vimeo API

Upload Vimeo video with CodeIgniter, Official PHP library for the Vimeo API. Vimeo Video upload with API using Official PHP library for the Vimeo API.

The library provides convenient access to the Epoint.az API from applications written in the PHP language.

Tural/Epoint library/SDK The library provides convenient access to the Epoint.az API from applications written in the PHP language. It includes a pre-

Releases(1.0.0.2)
Owner
Maximilian Osinski
from germany, born in '06.
Maximilian Osinski
This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

Daniel Henze 3 Aug 29, 2022
A PHP library for communicating with the Twilio REST API and generating TwiML.

twilio-php The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio API c

Twilio 1.4k Jan 2, 2023
PHP library to use IOTA REST API to help node management and tangle queries

iota.php About PHP library to use IOTA REST API to help node management and tangle queries. Please be aware that this library is in an early developme

IOTA Community 45 Dec 13, 2022
This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP

This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP

Twilio SendGrid 1.4k Dec 27, 2022
Lightweight PHP library for WhatsApp API to send the whatsapp messages in PHP provided by ultramsg.com

Ultramsg.com WhatsApp API PHP SDK Lightweight PHP library for WhatsApp API to send the whatsappp messages in PHP provided by Ultramsg.com Installation

Ultramsg 117 Dec 26, 2022
Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

Google APIs 8.4k Dec 30, 2022
Wise-php - This library is written to accommodate the wise API's use in php projects With Wise

Wise-php - This library is written to accommodate the wise API's use in php projects With Wise you can automate payments, connect your business tools, and create ways to manage your finances. You can also power your cross-border and domestic payouts.

Albert Xhani 15 Nov 17, 2022
Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

Nexmo 75 Sep 23, 2022
A simple PHP GitHub API client, Object Oriented, tested and documented.

PHP GitHub API A simple Object Oriented wrapper for GitHub API, written with PHP. Uses GitHub API v3 & supports GitHub API v4. The object API (v3) is

KNP Labs 2k Jan 7, 2023