• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Require a class from another class - php

phprequire


PHP Snippet 1:

require dirname(__FILE__, 2) . '/Task.php';

PHP Snippet 2:

require '../Task.php';

Related Snippets

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Using PHP to connect to a remote MSSQL database

Laravel Passport - Not able to get token string in response?

Add and update products to session cart in Laravel

Transform array, set each array element with parent key php

Laravel insert dynamic input values with radio button

Failing validation doesn't stop code execution in livewire component

Add New Parameter to Existing URL using htaccess

How to get page number on dompdf PDF when using "view"

PHP each() function replacement

Converting array to string and then back in PHP

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

Store / Website Column in Magento 2 Admin Grid - Custom Module

What is the difference between client-side and server-side programming?

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

About Contact Privacy policy Terms and conditions