- The
realpath()
function gives you the file-system path, with any symbolic links and directory traversing (e.g. ../../) resolved. Thedirname()
function gives you just the directory, not the file within it. __FILE__
is a magic constant that gives you the filesystem path to the current .php file (the one that__FILE__
is in, not the one it’s included by if it’s an include.- Sounds about right.
- This is to translate from Windows style (\) paths to Unix style (/).
Related Posts:
- How to prevent the “Confirm Form Resubmission” dialog?
- What is a slug?
- Only variable references should be returned by reference – Codeigniter
- Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)
- What does the PHP error message “Notice: Use of undefined constant” mean?
- CodeIgniter: Unable to connect to your database server using the provided settings Error Message
- Object of class stdClass could not be converted to string
- Replace ' and similar html codes with their correspondent character?
- navigate back with PHP form submission
- How do I make a redirect in PHP?
- How to fix “Headers already sent” error in PHP
- “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP
- http://localhost:80 is not working on running Apache server through UniServer ZeroXIII
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- How do I get PHP errors to display?
- Get the full URL in PHP
- How do I check if a string contains a specific word?
- How to force file download with PHP
- How to Set Category Page as Home Page in Prestashop
- Get the full URL in PHP
- How to copy a file from one directory to another using PHP?
- Getting an error when I visit http://localhost
- PHP random string generator
- What are the differences in die() and exit() in PHP?
- How to call a JavaScript function from PHP?
- PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
- Error 500: Premature end of script headers
- Cookies vs. sessions
- Expected status code 200 but received 500
- PDO with INSERT INTO through prepared statements
- Can you “compile” PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?
- How to get the file extension in PHP?
- Invalid argument supplied for foreach()
- Remove the last character from a string
- How to prevent Browser cache for php site
- what does a .php?id=&value=value means?
- Setting up a PHP interpreter in PhpStorm
- Get Current URL in Magento and show something
- php create object without class
- Creating a search form in PHP to search a database?
- How do I make a simple crawler in PHP?
- Create PDF file using PHP
- pdo – Call to a member function prepare() on a non-object
- Sort array of objects by object fields
- When to generate a new Application Key in Laravel?
- “Connection for controluser as defined in your configuration failed” with phpMyAdmin in XAMPP
- Call to undefined method mysqli_stmt::get_result
- Replace spaces with a dash in a URL
- Are PDO prepared statements sufficient to prevent SQL injection?
- Message: Trying to access array offset on value of type null [duplicate]
- retrieve data from db and display it in table in php .. see this code whats wrong with it?
- Count how many files in directory PHP
- What does it mean to escape a string?
- Creating default object from empty value in PHP?
- Send attachments with PHP Mail()?
- header location not working in my php code
- PHP Error: Function name must be a string
- Uncaught Error: Call to undefined function mysql_escape_string()
- Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by all
- Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
- Convert DateTime to String PHP
- Warning: mysqli_query() expects at least 2 parameters, 1 given. What? [duplicate]
- Xampp Access Forbidden php
- PHP cURL custom headers
- File attachment with PHPMailer
- Warning: mysqli_query() expects parameter 1 to be mysqli, resource given
- Fatal error: Call to undefined function money_format()
- Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 201:
- Mysql where id is in array
- XAMPP, using port:81, cannot run localhost:81/mywebsite
- How to extract and access data from JSON with PHP?
- What is the MM/DD/YYYY regular expression and how do I use it in php?
- Warning “Do not Access Superglobal $_POST Array Directly” on Netbeans 7.4 for PHP
- How to integrate WordPress with Angular 8 for website?
- Fatal error: Maximum execution time of 30 seconds exceeded
- cURL request in Laravel
- PHP array printing using a loop
- How to send to BCC address when using PHPMailer to format MIME message for Gmail API?
- Is there any way to test PHP locally without installing a server?
- PHP Redirect with POST data
- Getting the screen resolution using PHP
- PHP: fopen() Permission denied
- How should I be setting browscap.ini file
- Returning JSON from a PHP Script
- How to run a PHP function from an HTML form?
- Can I store images in MySQL
- MySQL Daemon Failed to Start – centos 6
- How to insert TIMESTAMP into my MySQL table?
- How to remove index.php from WordPress site URL
- Remove warning messages in PHP
- How to generate .json file with PHP?
- Call to a member function on a non-object [duplicate]
- Generate PDF from HTML PHP
- Call to a member function fetch_assoc() on boolean in
[duplicate] - How to use Memcached with PHP7?
- Remove empty array elements
- select count(*) from table of mysql in php
- Auto increment in phpmyadmin
- wordpress menu dropdown item not showing after first dropdown
- Use of undefined constant issue