function fp_get_machine_readable

7.x misc.inc fp_get_machine_readable($str)
6.x misc.inc fp_get_machine_readable($str)
5.x misc.inc 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 (_).

Parameters

unknown_type $str:

Return value

unknown

31 calls to fp_get_machine_readable()
admin.groups.inc in modules/admin/admin.groups.inc
admin_edit_group_form_validate in modules/admin/admin.groups.inc
Validate handler for edit group form.
advise.module in modules/advise/advise.module
advise_what_if_selection_form in modules/advise/advise.module
fp_render_button in includes/theme.inc
Returns the HTML to draw a pretty button.

... See full list

File

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

Code

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