Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
en:create:php [08.10.2014 09:27] – [Introduction to PHP] admin | en:create:php [21.12.2014 22:53] – admin |
---|
</code> | </code> |
| |
The function here is ''question''. In SoSciSurvey, this is the command to show a question. This command is followed by brackets. Because every function is always followed by brackets, a function name is usually written like this: ''[[functions-base#question|question()]]'' | The function here is ''question''. In SoSciSurvey, this is the command to show a question. This command is followed by brackets. Because every function is always followed by brackets, a function name is usually written like this: ''[[:en:create:functions:question|question()]]'' |
| |
The brackets contain parameters. This defines what the function actually should do. The parameter here is ''%%'AB01'%%''. The single quotes indicate: //AB01// is a text, called "string". You can also use double quotes: ''%%"AB01"%%''. | The brackets contain parameters. This defines what the function actually should do. The parameter here is ''%%'AB01'%%''. The single quotes indicate: //AB01// is a text, called "string". You can also use double quotes: ''%%"AB01"%%''. |
The equal sign (%%=%%) is an operator. In this case it makes sure, the output of the function ''random()'' is saved in the variable ''$number'' on the left. So the variable ''$number'' now contains a random number. | The equal sign (%%=%%) is an operator. In this case it makes sure, the output of the function ''random()'' is saved in the variable ''$number'' on the left. So the variable ''$number'' now contains a random number. |
| |
If we want to print the random number onto the screen, we need the command ''[[functions-output#html|html()]]''. This function does nothing else than to print HTML-code (which is, basically, text) into the questionnaire. | If we want to print the random number onto the screen, we need the command ''[[:en:create:functions:html|html()]]''. This function does nothing else than to print HTML-code (which is, basically, text) into the questionnaire. |
| |
<code php> | <code php> |
{{:en:create:scr.php.random-h1.png?nolink|Output formatted text}} | {{:en:create:scr.php.random-h1.png?nolink|Output formatted text}} |
| |
**Tip:** More detailed explanations about the function is given at ''[[functions-output#html|html()]]''. | **Tip:** More detailed explanations about the function is given at ''[[:en:create:functions:html|html()]]''. |
| |
===== List of available functions (references) ===== | ===== List of available functions (references) ===== |