Как отладить Ваш PHP сайт для использования UTF8. ЧАСТЬ 3 - Jaaj.Club
Poll
Which tsar do you think was closest to God in spirit?


Events

07.09.2025 17:28
***

Started
from the publishing house Collection Jaaj.Club.

Write a science fiction story up to 1 author page and get a chance to be included in a collective collection and get reviewed by renowned authors.

Jury of the contest

Alexander Svistunov
Fantasy writer, member of the Union of Writers of Uzbekistan and the Council for Adventure and Fantastic Literature of the Union of Writers of Russia.

Katerina Popova
A modern writer working in the genre of mysticism, fantasy and adventure thriller. The author does not deprive her works of lightness, humor and self-irony.

Maria Kucherova
Poet and prose writer from Tashkent. The author works in the genres of mysticism, drama and thriller, creates a series of novels and novellas in a single fictional universe.

Konstantin Normaer
A writer working at the intersection of genres: from fantasy detective and steampunk to dark fantasy and mystical realism.

Yana Gros
Writer-prose writer, the main direction - grotesque, social satire, reaction to the processes that are happening today. Laureate and diploma winner of international competitions.

Jerome
Author of the "Lost Worlds" series, specializing in space fiction and time travel. Author of numerous science fiction stories.

Artyom Gorokhov
Artem Gorokhov
Writer-prose writer, author of novels and many works of small prose. The head of seminars of creative community of poets and prose writers.

Olga Sergeyeva
Author of the collection of fantastic stories "Signal". Master of science fiction and mysticism, exploring time, memory and the limits of human possibilities.

***
12.08.2025 18:44
***

On Sale!

Echo of Destruction is a new post-apocalyptic novel
Zoya Biryukova.

A post-catastrophe world, an ancient war between vampires and werewolves, and a ritual that will decide the fate of humanity.


Zoya Biryukova is a gamer and dark fantasy fan. Her love for the worlds of vampires and werewolves inspired her to create her own story about the post-apocalypse and ancient powers.

***
02.07.2025 20:55
***

Already on sale!

A new story from Katerina Popova in a mystical novel


Anybody Alive? - Katerina Popova read online

***

Comments

Благодарю
28.10.2025 Болеслав
Благодарю
28.10.2025 Болеслав
Интересная идея!
28.10.2025 Jaaj.Club
Очень грамотно и интересно раскрыта не совсем новая, но животрепещущая для научной фантастики тема, отчего общая оценка только выигрывает! Большое спасибо!
28.10.2025 Formica
Коротко, но настолько интригующе. Хочется полной развёрнутой истории.
28.10.2025 Palevka-89

Как отладить Ваш PHP сайт для использования UTF8. ЧАСТЬ 3

10.02.2015 Рубрика: High tech
Автор: qwertynet
Книга: 
2934 0 0 2 283
В статье рассматривается самый частый случай - работа с XML контентом в PHP файле

Работа с XML контентом в PHP файле


В продолжение предыдущим статьям (раз, два) про кодировку UTF-8 в PHP. Данная статья коснется самого исполнительного кода, который вы гравируете на сердце вашего сайта. Рассмотрим самый распространенный пример – работа с XML контентом.

Если вы намерены вывести XML контент из PHP файла, вам необходимо установить тип контента вручную при помощи заголовка. Использование заголовка content-type (text/html) дает понять браузеру, что сейчас будет выводиться XML контент. Используйте следующую конструкцию в вашем file.php:

<?php
header (“Content-Type: text/xml”);
?>
<your_xml_content>
</your_xml_content>

Определение типа вашего контента при помощи content-type объяснит браузеру, как принять поступающую информацию и правильно отобразить её на экран. Например, если поступила мультимедийная информация, браузер предложит воспользоваться другим приложением для её воспроизведения, если будет не в силах сам этого сделать.  Так, при появлении *.mp3 файла, браузер предложит использовать проигрыватель установленный у вас на компьютере, а для текстовых файлов может предложить скачать их для просмотра в редакторе. Обычно text/xml файлы рассматриваются, как ASCII, но часто бывает, что браузер не способен распознать символы и перекладывает эту обязанность на ваши плечи. Этого можно избежать, если твердо указать какой тип вы используете. Необходимо прописать следующий заголовок:

  header('Content-Type:  application/xml;  charset=utf-8');

Заголовок типа application/xml с указанной кодировкой замечательно подойдет для универсального использования. 

Этот способ еще удобен тем, что он работает вне зависимости от того, какая кодировка стоит по умолчанию у вашего сервера управления БД. 

Sign up for our free weekly newsletter

Every week Jaaj.Club publishes many articles, stories and poems. Reading them all is a very difficult task. Subscribing to the newsletter will solve this problem: you will receive similar materials from the site on the selected topic for the last week by email.
Enter your Email
Хотите поднять публикацию в ТОП и разместить её на главной странице?

Переход на PHP 5.4

Некоторые новшества появившиеся в новой версии PHP 5.4 Читать далее »

Эти непонятные слова. Физический и программный токен

Слово токен появилось еще очень давно. Но, люди начали его активно употреблять в повсеместной речи около 10 лет назад. Сейчас постараемся разобраться в сложившейся ситуации. Читать далее »

Комментарии

-Комментариев нет-