Skip to content

Instantly share code, notes, and snippets.

@userlond
userlond / get_absolute_path_to_class_filename_by_object.php
Last active January 28, 2019 04:38
Get absolute path of class file by its object
<?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 February 3, 2016 11:51 — forked from ohaal/find_relative_path.func.php
Find the relative path between two paths
<?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
*/