php get class name without namespace from string
return substr(strrchr(__CLASS__, "\"), 1);
php get class name without namespace from string
return substr(strrchr(__CLASS__, "\"), 1);
php namespace class
<?php
namespace mname; // see "Defining Namespaces" section
class MyClass {}
function myfunction() {}
const MYCONST = 1;
$a = new MyClass;
$c = new mynameMyClass; // see "Global Space" section
$a = strlen('hi'); // see "Using namespaces: fallback to global
// function/constant" section
$d = namespaceMYCONST; // see "namespace operator and __NAMESPACE__
// constant" section
$d = __NAMESPACE__ . 'MYCONST';
echo constant($d); // see "Namespaces and dynamic language features" section
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us