path - PHP - Correct way to define Site_Root and App_Root -


i have these 2 constants defined:

define( 'site_root',$_server['document_root'] . '/' );  define( 'app_root', str_replace('\\', '/', dirname(dirname(__file__))) . '/' ); 

my folder structure this:

site_root (exampledomain.com)    - docs    - tests    - app       - assets       - libs       - core 

if use :

$appassets = app_root.'assets/css/'.$filename.'.css'; 

it echos path as:

http://exampledomain.com/var/www/app/assets/css/core.css 

how can rid of var/www/ bit echoed path?

i want value of 'site_root' 'http://exampledomain.com/'

and value of 'app_root' 'http://exampledomain.com/app/'

how can achieve this?

define( 'app_root', '/app/'); 

if really need constant this


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -