This function highlight_string() outputs or returns a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP.
<?php
highlight_string('<?php phpinfo(); ?>');
?>
<?php
highlight_string('<?php phpinfo(); ?>');
?>
highlight_string() function can be really helpful: It outputs or returns a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP.<?php
highlight_string('<?php phpinfo(); ?>');
?>
?php $str = "How many words do I have?"; echo str_word_count($str); //Outputs 5 ?>
levenshtein() is just the function you need. This function can be super useful to track user submitted typos.<?php $str1 = "carrot"; $str2 = "carrrott"; echo levenshtein($str1, $str2); //Outputs 2 ?>
get_defined_vars() is called.print_r(get_defined_vars());
escapeshellcmd() escapes any characters in a string that might be used to trick a shell command into executing arbitrary commands. This function should be used to make sure that any data coming from user input is escaped before this data is passed to the exec() or system() functions, or to the backtick operator.<?php $command = './configure '.$_POST['configure_options']; $escaped_command = escapeshellcmd($command); system($escaped_command); ?>
<?php var_dump(checkdate(12, 31, 2000)); var_dump(checkdate(2, 29, 2001)); //Output //bool(true) //bool(false) ?>
<?php // PHP comment here /* * Another PHP comment */ echo php_strip_whitespace(__FILE__); // Newlines are considered whitespace, and are removed too: do_nothing(); ?>
<?php echo php_strip_whitespace(__FILE__); do_nothing(); ?
Hello Friends! I am Ramana a part time blogger from Hyderabad.