<?php
namespace cart; // Functions in cart namespace
?>
<?php
namespace murach\cart {
// Functions in murach\cart namespace
}
?>
<?php
namespace cart {
// Functions in cart namespace
}
?>
<?php
namespace murach\errors {
function log($error) {
echo(<p> class='error'>$error</p>
}
}
?>
// load the file that stores the namespace
require_once 'errors.php';
// call the log function murach\errors\log('Invalid value');
// create an alias and use it to call the log function
use murach\errors as e; // Use 'e' instead of 'murach\errors'
e\log('Invalid value');