Answer the question
In order to leave comments, you need to log in
How to insert a class variable into a string without dots?
There is a class
class Names {
public static $egor = "Egor Ignatich";
}
$mail = "Welcome to php, Mr ...";
Names::$egor
? Answer the question
In order to leave comments, you need to log in
$mail = "Welcome to php, Mr %s";
echo sprintf($mail, Names::$egor);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question