The best thing to do in a project like this is to define a constant pointing to the current working directory and then use it throughout your app.
For example, consider the following:
chat/index.php
<?php
// Constants
define('CWD', getcwd()); // points to C:/wamp/www/ooplr/chat
// Load Init Script
require CWD .'/../core/init.php'; // points to C:/wamp/www/ooplr/core/init.php
// Rest of code ...
?>
core/init.php
<?php
// Load Sanitizer
require CWD .'/../functions/sanitize.php' // points to C:/wamp/www/ooplr/functions/sanitize.php
// Rest of the code
?>
etc...
Alternatively...
chat/index.php
<?php
// Constants
define('BaseDir', getcwd() .'/../'); // points to C:/wamp/www/ooplr/
// Load Init Script
require BaseDir .'core/init.php'; // points to C:/wamp/www/ooplr/core/init.php
// Rest of code ...
?>
core/init.php
<?php
// Load Sanitizer
require BaseDir .'functions/sanitize.php' // points to C:/wamp/www/ooplr/functions/sanitize.php
// Rest of the code
?>