Skip to content

Instantly share code, notes, and snippets.

@userlond
userlond / get_absolute_path_to_class_filename_by_object.php
Last active Jan 28, 2019
Get absolute path of class file by its object
View get_absolute_path_to_class_filename_by_object.php
<?php
/**
* Get absolute path of class file by its object
* @param $object Object instance
* @return string|null
*/
function get_absolute_path_to_class_filename_by_object($object)
{
$className = get_class($object);
try {
@userlond
userlond / find_relative_path.func.php
Last active Feb 3, 2016 — forked from ohaal/find_relative_path.func.php
Find the relative path between two paths
View find_relative_path.func.php
<?php
/**
*
* Find the relative file system path between two file system paths
*
* @param string $frompath Path to start from
* @param string $topath Path we want to end up in
*
* @return string Path leading from $frompath to $topath
*/