How to create shortcode function in WordPress

This is the basic Syntax to Create shortcode Function in wordpress:

add_shortcode(string 'shortcode_name', callable 'shortcode_function_name');


shortcode_name : This parameter 1 to be used in post content

shortcode_function_name :  This parameter is used to call the function to execute

Example 1 : This is used in the code level

<?php echo '[shortcode_name]';  ?>

Example 2 : This is used in the content area