• 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

Creating live search with AJAX and CodeIgniter

Array to string conversion

Add New Parameter to Existing URL using htaccess

Laravel eloquent update record without loading from database

How to install php_imagick on wamp64

how to redirect the user back to desired URL after login page in PHP?

How to make a foreign key not using primary key

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

Get all WooCommerce products within own plugin

Cannot connect to own websocket server when on secured domain

How to connect to MSSQL Server with PHP from Ubuntu 18.04?

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

image source not readable

Symfony - "framework.test" config is not set to true

using random function but it's displaying duplicates

About Contact Privacy policy Terms and conditions