Pro PHP XML and Web Services phần 3

và minOccurs, mà cả hai mặc định là 1, có thể được lựa chọn. Sử dụng tất cả các cho phép các yếu tố để xuất hiện trong thứ tự bất kỳ, mặc dù tất cả các yếu tố phải có mặt trong nội dung của một phần tử mẹ. Khi bạn tạo được đặt tên nhóm, bạn có thể chia sẻ chúng, do đó bạn không cần phải xác định các nhóm địa phương | 172 CHAPTER 5 PHP AND XML based on libxml2 you need to convert isostring to UTF-8. The code in Listing 5-4 illustrates how to perform this conversion using both iconv and mbstring but you need to use only one . Be aware of the ordering of arguments for the functions. From the PHP manual the prototypes for these functions are as follows string mb_convert_encoding string str string to_encoding mixed from_encoding string iconv string in_charset string out_charset string str After performing the conversions the strings using UTF-8 encoding utf8string and utf8string2 are then used as values for the content of the DOMElement objects. Naturally these elements are added to the document within the omitted code. When reading the content of these objects the reverse conversions are performed and stored in isostring1 and isostring2. These strings will contain the same string as the original isostring variable. Whether you need to worry about internal encoding depends upon the character set of the data you are using. In many cases you will be using the UTF-8 and ASCII character sets and in these cases you do not need any conversions. When working with documents containing language-specific data or when working with internationalization and XML you must deal with encoding properly. Figuring Out the libxml2 Version In some cases the version of libxml2 used determines whether you can use certain functionality within an extension. For example namespace support within the xml extension is functional only when running libxml2 . Although is the minimum version for PHP PHP can use XML functionality with at least . Attempting to use namespace support through the xml_parser_create_ns function when running PHP with a version of libxml2 results in an error message Please upgrade to libxml2 . You may also find that other extensions require other minimum versions to utilize certain functionality and methods. This can make writing software difficult .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
1    299    3    16-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.