How to get substring between two substrings?

I want to extract a substring between two substrings. The problem is that it will extract only the first one. I want to do it in all of my document. Example : function getBetween($content,$start,$end){ $r = explode($start, $content); if (is...
more »

2017-08-30 14:08 (2) Answers

Find two diferent substr in PHP

I have some trouble, maybe you can help me: $str = "This is one string with this picture pic1.jpg and here there's another one pic2.png for example" I want to use something similar to preg_match_all() but I would like to do it just in one line. I...
more »

2017-07-15 19:07 (2) Answers

need some help on regex in preg_match_all()

so I need to extract the ticket number "Ticket#999999" from a string.. how do i do this using regex. my current regex is working if I have more than one number in the Ticket#9999.. but if I only have Ticket#9 it's not working please help. current r...
more »

2017-05-04 15:05 (1) Answers

php - how to get specific value from the string

I am facing issue when trying to extract specific value from the string but not getting the proper output. $string =[id=257,rapidViewId=94,state=CLOSED,name=Alert Success 5,goal=,startDate=2016-08-16T20:20:...
more »

2017-03-05 15:03 (2) Answers

preg_match_all from array php and input form

Hi I want to search form using preg_match_all. Why it needed? I have DB that having two fields 'id' and 'text'. I must to search some text from this DB with rules like ..a..., a..a.. and etc. I tried so many ways I am a newby on php and programming t...
more »

2017-01-27 07:01 (3) Answers

How to regexp PHP looking for numbers in string

I've problem with regexp and I'm looking solutions for this problem. I need to find in text numbers where is more than 3 digits, but I need to omit when number have on beginning/last $ char. Example: Lorem ipsum dolor 32 sit 32181527 amet, consec...
more »

2017-01-22 12:01 (1) Answers

Regex - get elements to render if statement

I'm designing a script and trying to get to the if construct without eval in php. Still incomplete but blasting through, it's to do a templating engine, the "if" part of the engine. no Assignment operators allowed, but I need to test values without ...
more »

2016-06-12 10:06 (2) Answers