If your included file returned a variable…
include.php
<?php
return 'abc';
…then you can assign it to a variable like so…
$abc = include 'include.php';
Otherwise, use output buffering.
ob_start();
include 'include.php';
$buffer = ob_get_clean();
More Related Contents:
- What are these exactly?: Composer, Git and Pyrus [closed]
- I want to use jquery nested sortable plugin with drag and drop in codeigniter using mysqli
- Array to string conversion in php check my code
- PHP Fatal error: Using $this when not in object context
- How to return outer html of DOMDocument?
- json_decode returns NULL after webservice call
- A non well formed numeric value encountered
- How to generate all permutations of a string in PHP?
- PHP login system: Remember Me (persistent cookie) [duplicate]
- Call to undefined function oci_connect()
- Find Month difference in php? [duplicate]
- .htaccess issues: No input file specified
- Fatal error: Class ‘ZipArchive’ not found in
- Sorting Laravel Collection via Array of ID’s
- Laravel Eloquent display query log
- PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR
- How to execute Stored Procedure from Laravel
- How can I split a string in PHP at the nth occurrence of a needle?
- WordPress: Loading multiple scripts with enqueue
- Using AJAX to pass variable to PHP and retrieve those using AJAX again
- PHP short circuit lazy evaluation, where is it in the php.net manual?
- Output text file with line breaks in PHP
- PHP: Create an array for a range
- WSDL to PHP with Basic Auth
- How to handle PDO exceptions [duplicate]
- MySql PHP select count of distinct values from comma separated data (tags)
- PHP mysql_real_escape_string() -> stripslashes() leaving multiple slashes
- PHP Session ID changing on every request
- Backup a mysql database and download as a file
- How to give container as argument to services