pods_clean_name

(Since 1.2.0) -- Return a lowercase alphanumeric name (with underscores)
function pods_clean_name($name)
Takes an input string and cleans it to be suitable as a Pod, Template, or Helper name.
  • All spaces or dashes are converted to underscores
  • All non-alphanumeric characters (except for underscores) are removed
  • The string is converted to lowercase

Parameters

ParameterTypeDetails
$name STRING the string to be formatted

Examples

<?php
echo pods_clean_name('THE *string* is (properly) formatted!');
// Returns: "the_string_is_properly_formatted"
?>
See Also