Need PHP pregmach Regexp pattern for string until “|||” characters appears

I have PHP variable that contains string like:|||||||||...

I need to get first one image url from that string, so it will be string until first "|||" characters. So result i need to get into variable is:

Please help me to write correct PHP preg_match regexp pattern for it.

Thank you! Tim


This should work:


You could also use expode:

$result = explode('|||', $s, 2);
echo $result[0];


See it working online: ideone

Need Your Help

platform_device_register and usb ehci driver

linux linux-kernel linux-device-driver

I'm trying to understand how linux initializes USB EHCI controller on my cambria (ARM) board.

Paypal Recurring Payment through ACH in Php

php paypal payment recurring

I have researched through the Paypal website regarding Recurring ACH payment in PHP but could not find any satisfying solution. Paypal has mentioned SDKS for C# & Java for Recurring ACH, but no...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.