PHP functions

Learn how to use PHP functions in an exercise

Updated over a week ago

The variables in the Variables tab of an exercise are written in PHP (see this article). This means we sometimes need to use PHP functions in a variable definition. Not all PHP functions are allowed. For a list of all allowed PHP functions, including a link to the PHP manual, see the authoring manual.

There are also some PHP functions made by SOWISO, mostly focused on making mathematical operations easier. A list of SOWISO-made PHP functions and their specifications can be found in the authoring manual.

PHP is very limited if it comes to advanced mathematical calculations. For example, it is not easy to do differentiation using just PHP. If we want to do differentiation or another advanced mathematical operation in the variables, we need another programming language. At this moment, the languages Python, Maxima, and R are supported.

Click here to learn how to define variables using Maxima, here to define variables using Python and here to define variables using R.

Did this answer your question?