How to replace all image addresses with regular expressions
SpaceX announced the design scheme for the second generation manned "dragon" spacecraft, which can contain a maximum of 7 people
The US SpaceX company today released the second generation of Dragon V2, the first manned spacecraft launched by a private company to ship up to seven astronauts at a time to the International Space Station, according to NASA and SpaceX, Dragon 2 is expected to officially fly to space in 2017.
According to Elon Musk, co-founder of SpaceX, it can return to the Earth and "precisely land on any ground like a helicopter, and it can be quickly reused. You just need to re-inject the propellant, and then you can try again ...... Imagine that if the spacecraft is discarded after each task, no one will be able to afford this flight cost ." # P # subtitle # e #
Add a URL before an existing image address, similar to a http://www.xxxx.com/uploadpic/allimg/140603/23-140603131R9.jpg
Reply to discussion (solution)
$ S = <TXTSpaceX announced the design scheme for the second generation manned "dragon" spacecraft, which can contain a maximum of 7 people
The US SpaceX company today released the second generation of Dragon V2, the first manned spacecraft launched by a private company to ship up to seven astronauts at a time to the International Space Station, according to NASA and SpaceX, Dragon 2 is expected to officially fly to space in 2017.
According to Elon Musk, co-founder of SpaceX, it can return to the Earth and "precisely land on any ground like a helicopter, and it can be quickly reused. You just need to re-inject the propellant, and then you can try again ...... Imagine that if the spacecraft is discarded after each task, no one will be able to afford this flight cost ." # P # subtitle # e #
TXT; echo preg_replace ('/ For non-complex ones, you do not need regular expressions.
$ Content = str_replace ('src = "', 'src =" http://www.xxxx.com', $ content );
If some Image addresses already have URLs, how can this problem be solved?