Новые книги

«Индустрия счастья» – блестящий взгляд на реалии современности. Компании, анализирующие подтекст наших твитов, сканирование эмоций с лица в общественных местах. Это всё очень увлекательно и позволяет задуматься: почему наше счастье – такая полезная информация для крупных организаций?
Comprehensive Real-World Guidance for Every Embedded Developer and Engineer

This book brings together indispensable knowledge for building efficient, high-value, Linux-based embedded products: information that has never been assembled in one place before. Drawing on years of experience as an embedded Linux consultant and field application engineer, Christopher Hallinan offers solutions for the specific technical issues you're most likely to face, demonstrates how to build an effective embedded Linux environment, and shows how to use it as productively as possible.

Hallinan begins by touring a typical Linux-based embedded system, introducing key concepts and components, and calling attention to differences between Linux and traditional embedded environments. Writing from the embedded developer's viewpoint, he thoroughly addresses issues ranging from kernel building and initialization to bootloaders, device drivers to file systems.

Hallinan thoroughly covers the increasingly popular BusyBox utilities; presents a step-by-step walkthrough of porting Linux to custom boards; and introduces real-time configuration via CONFIG_RT--one of today's most exciting developments in embedded Linux. You'll find especially detailed coverage of using development tools to analyze and debug embedded systems--including the art of kernel debugging.

• Compare leading embedded Linux processors

• Understand the details of the Linux kernel initialization process

• Learn about the special role of bootloaders in embedded Linux systems, with specific emphasis on U-Boot

• Use embedded Linux file systems, including JFFS2--with detailed guidelines for building Flash-resident file system images

• Understand the Memory Technology Devices subsystem for flash (and other) memory devices

• Master gdb, KGDB, and hardware JTAG debugging

• Learn many tips and techniques for debugging within the Linux kernel

• Maximize your productivity in cross-development environments

• Prepare your entire development environment, including TFTP, DHCP, and NFS target servers

• Configure, build, and initialize BusyBox to support your unique requirements

str_replace

Учебник РНР
НазадВперёд

str_replace

(PHP 3>= 3.0.6, PHP 4)

str_replace - замещает все вхождения строки поиска строкой замещения.

Описание

mixed str_replace (mixed search, mixed replace, mixed subject)

Эта функция возвращает строку или массив со всеми вхождениями search в subject, заменёнными данным значением replace. Если вам не нужны какие-то особые правила замещения, вы всегда должны использовать эту функцию вместо ereg_replace() или preg_replace().

В PHP 4.0.5 и новее каждый параметр для str_replace() может быть массивом.

Если subject это массив, то поиск и замена выполняется с каждым вхождением subject, а return-значение также является массивом.

Если search и replace это массивы, то str_replace() принимает значение из каждого массива и использует его для поиска и замены в subject. Если replace имеет меньше значений, чем search, то пустая строка используется для остальных замещающих значений. Если search это массив, а replace - строка, то эта строка замещения используется для каждого значения search.

Пример 1. str_replace()
$bodytag = str_replace("%body%", "black", "<body text=%body%>");

Эта функция бинарно безопасна/binary safe.

Примечание: str_replace() была введена в PHP 3.0.6, но была с багами до PHP 3.0.8.

См. также ereg_replace(), preg_replace() и strtr().


Назад Оглавление Вперёд
str_repeat Вверхstr_rot13