Whether or not a contact receives the welcome email or confirmed opt-in email is determined by the <OptInSource> node used for each particular contact. The two possible values for this field are:
ACTION_BY_CUSTOMER - This is for internal applications, and is the OptInSource used when the site owner adds a contact from inside their account. This will not trigger a welcome or confirmation email being sent when a contact is added with this OptInSource, and is the default OptInSource used in the PHP sample.
ACTION_BY_CONTACT - This is the OptInSource for site visitors, and should be used for web sign-up forms. This will trigger the welcome and confirmation emails to be sent to the email address that signed up.