PHP – How to get or set the path of a domain?


The bindtextdomain() function in PHP is used to set or get the path of a domain.

Syntax

string bindtextdomain($str_domain, $str_directory)

Parameters

bindtextdomain() accepts two parameters −

  • $str_domain − This is the domain.

  • $str_directory − This is the directory path. If the directory path is NULL, then it will return the currently set directory.

Return Values

bindtextdomain() returns the full specified pathname for the domain which is currently set. It will return False on the failure.

Example

<?php
   // domain of the app
   $str_domain = 'xampp';

   // It will return the domain path
   echo bindtextdomain($str_domain,'C:\xampp\htdocs');
?>

Output

C:\xampp\htdocs

Updated on: 12-Oct-2021

429 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements