The code 0034 or 34 is Spain's country calling code. When making a call to Spain from another country, this two number prefix is used before an area or city code. Different cities in Spain have different city calling codes.
The city calling codes can be either a two-number or three-number prefix. For example, to call someone in Madrid, use the prefix 34-91 before dialing the specific telephone number. To call Cordoba, Spain, use the prefix 34-957.
The same process for calling into Spain is used for calling out. Use Spain's two-number code followed by the desired area's prefix to reach individuals outside the country. Websites such as countrycode.org list the different country codes available.