This chapter shows you the main functions of PHP-Code Elements which can be used. The Introduction in PHP-Code will help you to integrate all PHP functions for your questionnaire.
At the very end of this page will be a helpful information how the documentation of the PHP-functions can be read: Function in Detail
See also filter questions und filters.
value() – Use answer of participant, e.g. for a filter questiongoToPage() – Jump to another page immediatelygoToPage('end') – End the current interviewrepeatPage() – Show recent page againredirect() – Redirect the respondent to a different websitequestion() – Display a question within the questionnairetext() – Display a text element within the questionnairedebug() – Show content of a data or PHP variableoption() – Modify page display settings (buttons, progress bar)preset() – Preset a response for a questionmarkFail() – Set the marker “response missing” for an inputhtml() – Output of HTML-Code within questionnairetextlink() – Create a hyperlink that shows a text element in a pop-up windowbuttonToPage() – Button to jump within the questionnairebuttonCode() – Create-HTML-Code for next/back buttonbuttonHide() – Do not show back/next buttons at the page's bottomlibrary() – Make a JavaScript or PHP library availablepageCSS() – Add CSS instructions to a single questionnaire pagepageHead() – Store meta-information about the questionnaire pageSoSci Survey supports several functions for random sampling or random group assignment (Randomization).
put() – Save a value in the data setrandom() – Dice a random number (with replacement)random_p() – Random number in correlation to likelihoodrandom_items() – Randomly select items from a listrandomUse() – Storing slips of paper from a random number generatorurnDraw() – Draw out from urn (random selection without replacement)urnPutAway() – Put away the chit drawn via urnDraw()urnStatus() – Retrieve current status of an urnregisterVariable() – Register PHP-Variable for following sitesid() – Create a question or variable label from it's componentsreplace() – Prepare a placeholdergetItems() – Order items of question by selected rulesgetQuestions() – Enlist a section's questionsgetItemtext() – Retrieve the text of a specific items or optiongetValueText() – Retrieve the label of a response code/optiongetTextElement() – Retrieve the content of a text elementgetRoute() – Tell if the next or back button was hit previouslycaseNumber() – Number of actual interviewscaseSerial() – Serial number used in interviewcaseTime() – Show length of stay on one or more sitescaseToken() – Identification of interviewreference() – Ask for reference (within link to questionnaires)serialCheck() – Ask for serial numberreadGET() – Read converted variable from linksendJSON() – Send HTTP request in JSON format (REST API)sendPOST() – Send HTTP request in POST format (REST API)sendXML() – Send HTTP request in XML format (REST API)getAnswerMissing() – Information for site repeat if questions was obligatedlistFails() – List of not responded obligation questionssetNextPage() – Set side for click on ,,go further“setPageOrder() – Change the order to display subsequent questionnaire pages loopPage() – Show a page multiple times in a looploopToPage() – Show multiple pages multiple times in a looppageStop() – Do not show any further contents on the questionnaire pagegetLanguage() – Determine languagesetLanguage() – Change languagegoToQuestionnaire() – Jump from one Questionaire to the next (once)goToParent() – Go back to the formerly QuestionairemultiLevelDown() – Start a sub-questionaire inside the main questionaire (if necessary also several times)multiLevelData() – Get data specified in multiLevelDown()multiLevelReturn() – Return from the sub-questionnaire to the main questionnaire multiLevelResponse() – Get data specified in multiLevelReturn() multilevelput – Write a value directly into the higher-level recordmultiLevelURL() – Create a URL for a sub-questionnaire to be used laterdropValue() – Delete a single variable from the current interviewdropCase() – Mark the current interview for deletiondropHistory() – Delete the page history of the current interviewstatistic() – Simple statistical analysis of all datadiagram() – Simple diagram (e. g. frequency) for all analyzed dataanswers() – Show a question including the respondent's answersanswersPrint() – Display all questions of a questionnaire segment including the respondent's answersinfo() – Meta informationen about the current interview case or the display modevalueSum() – Compute sum over scale or variablesvalueMean() – Compute mean over scale or variablevalueSD() – Compute standard deviation over scale or variablevalueVar() – Compute variance over scale or variableconvertDateTime() – Convert date/time texts (strings) and timestampsdiagram2() – Create diagram with set datagetQRCodeImage() – Integrate QR Code in the questionnaireimagepng_embed() – Include a PNG graphic without storing it to a filemailResume() – Resume an interview after a given delaymailSchedule() – Schedule to send a mailing to a single recipientmailRevoke() – Cancel a scheduled mailingpanelData() – Resolve information on the address recordPHP provides a number of helpful functions, which can easily be used during questionnaire PHP Manual documented.
Some functions pose a security risk or do not work as expected in the context of the questionnaire. Alternatives are listed below. If you need additional features, please let SoSci Survey know.
echomysqld_query()Reference-syntax for each function, e.g.:
void set(mixed Value, [string Memory])
This reference-syntax describes the argumentation of functions and it's data type.
set() has o have at least one argument Value than it is allowed to use another (second) argument Memory .