Concatenate a string with the output of a php function as a parameter of anouther function -


When I call the function mainfunc () I want to have a clear value near the output As a parameter of mainfunc () I want to do some time such as a mainfunc ('foo'.LaTeX ()); .

But, when I do this, I get the output of LaTeX () before "foo" it really does LaTeXfoo for me Print LaTeX () is LaTeX ) and I only get one when I try to index it like LaTeX ().

Then, this function LaTeX () :

  function latex (?) {? & Gt; ; & Lt; Span class = "latex" & gt; L & LT; SPU & gt; & Lt; / Sup> T & LT; Sub & gt; E & lt; / Sub & gt; X's & lt; / Span & gt; & Lt ;? Php}  

So, do I LaTeX () function, please? You can do this by using

mainfunc to get exactly fooLaTeX

The answer is simple:

Do not print (what happens if you close the PHP code and reopen it again).

The following two lines of code essentially do the same thing (they are equivalent):

  echo & lt; B & gt; Hello World! & Lt; / P & gt; '; ? & Gt; & Lt; P & gt; Hello world & lt; / P & gt; & Lt; Php  

Instead, work with return value:

  Festival LaTeX () {Return '& lt; Span class = "latex" & gt; L & LT; Support & gt; & Lt; / Sup> T & LT; Sub & gt; E & lt; / Sub & gt; X's & lt; / Span & gt; '; }  

This will create the behavior you are looking for. However, if you only plan on returning a certain string, better define a constant:

  (LaTeX, '& lt; span class = "latex"> L & LT; Support & gt; & lt; / sup & gt; T & lT; sub & gt; E & lt; / sub & gt; X & lt; / span & gt; '); Mainfunk ('Foo'. Latex);  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -