<?php //Create array of paths --example from your path ***use right paths***; $path = array( 'SITE_ROOT' => $_SERVER['DOCUMENT_ROOT'], 'CORE_PATH' => '/core', 'INCLUDE_PATH' => '/inc', 'LAYOUT_PATH' => '/layout', 'BLOCK_PATH' => '/blocks', 'STATIC_PATH' => '/static' ); //usage: createPath( $path ); //Testiing echo SITE_ROOT; function createPath( $path ) { if( empty( $path ) ) { die("Array of path required!"); } foreach( $path as $constant => $path ) { if(!defined( strtoupper($constant) ) ) { define( strtoupper($constant), $path . '/'); } } }
You have javascript disabled. You will not be able to edit any code.