function fp_get_machine_readable

6.x fp_get_machine_readable($str)
4.x fp_get_machine_readable($str)
5.x fp_get_machine_readable($str)

Simple function to convert a string into a machine-readable string.

Useful for making possibly unsafe text work as an array index, a CSS class, etc. Replaces "bad" characters, or characters which might not be allowed for variables, for example, into underscores (_).


unknown_type $str:

Return value


20 calls to fp_get_machine_readable()
admin_edit_group_form_validate in modules/admin/
Validate handler for edit group form.
advise_what_if_selection_form in modules/advise/advise.module
fp_render_button in includes/
Returns the HTML to draw a pretty button.
fp_render_content in includes/
This is very similar to fp_get_form / fp_render_form, except in this case we are being passed the completed "render_array", which already contains all of our elements. We will call hooks on it, sort by weights, and then return the rendered…
fp_render_currently_advising_box in includes/
Draws the CurrentlyAdvisingBox which appears at the top of the screen, containing the student's information like name, major, etc.

... See full list


includes/, line 768
This file contains misc functions for FlightPath


function fp_get_machine_readable($str) {
  return preg_replace('@[^a-zA-Z0-9_]+@', '_', $str);