How to create sub site in wordpress multisite programmatically?

With wpmu_create_blog() function, we can create subsites easily.

Add the following code in your form submit

wpmu_create_blog ( 'your_domain', '/subsite_path',  'Title of Subsite', '1' );

NB: if your site url is https://www.example.com then your_domain is should be example.com

Ref: https://www.krishaweb.com/how-to-programmatically-create-new-site-in-wordpress-multisite-within-60-minutes/