php - declared variable += and a new variable not containing last data of the previous variable -


example:

$variable = somecode;  $variable .= somemorecode;  $variable .= somemoremorecode;   

i want make $variable2 containing somemoremorecode;


notes:

1) whitout rewritting somemoremorecode; part.

2) variables in function, can't declare $variable2 on code part interests me.


q: how can achieve ?

$variable2=somemoremorecode; return $variable2; //because it's in function. 

if have interpreted question, answer. if not, please try make example , share code.


Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

c# - Get the Class name in a class with atribute inside a attribute method -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -