Question mark in tags

Hello. Why some languages use question mark in their tag names such as in Xml (<?xml version=“1.0” ?>) and in php (<?php echo “hello” ?>) ? Does the question mark have a meaning in tags?

Thanks in advance.

This is known in SGML as a Processing Instruction, or PI. HTML is an application of SGML, while XML is a subset of SGML. XHTML is an application of XML.

A PI doesn’t mark up content like a normal tag. It is used for specifying instructions to the user agent’s parser.

You also have directives, which in SGML are surrounded by <!...>. The doctype declaration is an example. Directives can also contain comments, surrounded by pairs of double hyphens. So if you want a comment in HTML or XML you can write <!--comment-->. Another example is CDATA sections, marked up with <![CDATA[...]]>.

Thank you very much @AutisticCuckoo. Really benefited your answer.