Question:
php exit() function (10 points best answer)?
paul
2010-08-11 20:50:26 UTC
If I have a .php file with some javascript at the end of the file, will calling the php exit() function not execute the rest of the php code as well as the javascript. Or will the javascript code still be executed.
Three answers:
Shubhamoy
2010-08-12 00:57:16 UTC
Is the javascript enclosed in the PHP or is it outside the ?> php end tag?



If the javascript is enclosed with an echo then on exit() it won't execute but if it is not enclosed then it will surely execute.



Since exit() deals with the PHP & will stop the further execution of PHP code.
juliepelletier
2010-08-11 21:03:16 UTC
PHP generates the output file, so if you exit before outputting the Javascript, it will not be output.
feathers
2016-10-16 04:47:49 UTC
using the set function, you placing some information in an merchandise. oftentimes, you do no longer anticipate something in return, so there is in many cases no 'return' in a sequence function. although, there is no technical reason a sequence function ought to no longer return some thing. using the get function, you're asking what the suggestions interior the article is; of course, you anticipate some thing to be back: the value interior the article. it somewhat is like enjoying a make-have confidence game with somebody. you may tell that individual: "you're Superman."; in programming phrases, you would be placing this individual's call to Superman. you do no longer anticipate something in return. you additionally can ask that individual: "who're you?" In programming phrases, you try to get the call supplies of a individual-merchandise. The return value could be: "Superman."


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...