php


Variable class call and namespace in PHP


Using a variable containing the name of a class then creating a new instance of that class, I have a question on the way I call the class in the variable.
My code works:
use AppBundle\Entity\someEntity;
$entityName = "AppBundle\Entity\someEntity";
$instance = new $entityName();
Now, what I would like to do is change the $entityName variable for something more simple like $entityName="someEntity";
Anyone have any idea on how to do that?
I am using PHP5.5
Thanks

Related Links

PHP merge arrays coming from mysql_query
Friendly URLS / URL Rewriting using .htaccess on godaddy shared server
Paypal express checkout for nodejs application
how to submit a form to another page in wordpress plugin
Storing Value from a Query PHP MYSQL
PHP to post SQL command will only create and delete table
how to return more then 1 variable data from php user define function
PHP: Code won't work without oci_connect()
modify permissions for files created by php script
php script works in browser but trows fatal error at command line
In Magento what is the correct data flow from POST to controller to model to block to template?
Login in Android to an Api System
echo correct message without slash
only want to show some of the text
PHP View Counter
Getting the pdf invoice from WHMCS?

Categories

HOME
hpoo
ionic2
plesk
weblogic12c
bokeh
paypal-ipn
concurrency
postgresql-9.4
google-play-services
portable-class-library
openflow
iptables
implicit-conversion
twitter-oauth
fasm
cqrs
documentum
spring-amqp
xbap
mahout-recommender
orange-api
exe
jqxgrid
home
social-tables
multi-upload
batch-rename
sipp
backendless
restier
mod-wsgi
tightvnc
windowsiot
memory-fences
knights-tour
android-canvas
amazon-kms
dreamfactory
jfxtras
subclassing
ftp-server
mv
recovery
extbase
task-parallel-library
secure-coding
raytracing
vungle-ads
morphline
zend-form
nuclio
nusoap
sharpdx
redisson
android-webservice
mongodb-aggregation
kendo-editor
finder
gapi
jsonix
fuzzer
django-testing
cdo.message
pack
html.actionlink
netdatacontractserializer
css-paged-media
roxygen2
dynamics-ax-2012-r2
artisan
dbmigrate
physicsjs
shoes
ssmtp
nanomsg
vs-unit-testing-framework
dc
qt5.4
box2dweb
git-reset
prism.js
senchatouch-2.4
webaii
boolean-algebra
jms-serializer
assetic
acitree
statechart
rikulo
donut-chart
itunes-sdk
daap
server-name
pageheap
zotonic
hardcode
type-safety
memory-pool
sigar
mvcrecaptcha
snackjs
botnet
bll
pyjamas
3270

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App