Popular Articles

  1. sgapiArrayKeys(%%array)

    This is equivalent to the array_keys function in PHP. Return all the keys or a subset of the keys of an array To see an example or learn more other PHP functions and PHP programming, visit PHP Documentation . ...
  2. sgapiCurrentPageTitle()

    This function will return the title of the current page. Example The below example outputs the current page title to the page. Check it out in an Example Survey %%output .= sgapiCurrentPageTitle(); The output would ...
  3. sgapiMDecrypt

    Warning! We highly discourage use of this feature going forward as this has been deprecated in PHP. You will not be able to decrypt data encrypted through this method in the future.  Learn more. This is equivalent to mdecrypt_generic in PHP. ...
  4. sgapiStrCaseCmp(%%str1,%%str2,%%case=false)

    This is equivalent to the strcasecmp function in PHP. This function will compare %%str1 with %%str2 in a case-insensitive manner when %%case=false. The results are returned as either a negative number (str1 < str2), 0 (match), or a positive numbe...
  5. sgapiLog(%%number,%%base=10)

    This is equivalent to the log function in PHP. Returns the log of %%number. If the optional %%base parameter is specified, log() returns logbase %%number, otherwise log() returns the natural logarithm of %%number. To see an example or lea...
  6. Deselect a Radio Button

    Once an answer option has been selected in a Radio Button question browsers do not allow for the option to be deslected. That could be troublesome if it was an accidental click with no Other or N/A options, so here is a quick bit of JavaScript tha...
  7. Radio Button/Checkbox Grid: Make Other Row Fill-ins Required

    Other Textboxes within grid questions do not force a response within the textbox in the row header. This JavaScript will disable and uncheck the row's answer options unless text has been input in the Other Textbox field. Check it out in an examp...
  8. sgapiPregSplit(%%pattern, %%subject, %%limit, %%flags)

    This is equivalent to the preg_split function in PHP. It allows you to split the given string by a regular expression. To see an example or learn more other PHP functions and PHP programming, visit PHP Documentation . ...
  9. sgapiSetColorPDF(%%pdf, %%r, %%g, %%b)

    This function sets the text color for the given pdf.  %%r, %%g, %%b are set to 0 (black) by default. For more info on PHP PDF Creation visit: https://github.com/rospdf/pdf-php/blob/master/readme.pdf Example The below script creates and build...
  10. sgapiKRSort(%%array, %%flag)

    This is equivalent to the krsort function in PHP. This function sorts an array by key in reverse order. Elements will be arranged in reverse order when this function has completed. The %%flag parameter defaults to "SORT_REGULAR". See the PHP ...