Skip to content
Advertisement

Tag: regex

Download images from html and keep the folder structure

I need to have download over 100.000 pictures. The Pictures have : .png, .jpg, .jpeg, .gif format. I have the approval to use those pictures. they have provide me an XML file with all the url`s The url have the structure otherdomain/productimages/code/imagename.jpg/.png/.gif I have all the codes in an php array called $codes[] I have also the full path of

PHP – format html b tags into header tags

I want to format multiple paragraphs to a better html structure There is a database with a column called bodytext $bodytext = $row[“bodytext”]; If i echo this you get multiple paragraphs This is one paragraph: — START paragraph 1 — END paragraph 1 The final result for one example paragraph: — START paragraph 1 — END paragraph 1 I want

Regex validation matching pattern1 and pattern2 in PHP

I need to match a string against two patterns both patterns must match the string. You could imagine it as some sort of validation chain. Patterns in below code are just examples. I know code below is a possible solution, but I’m interested to know can it be done with one preg_match by joining patterns together somehow. Answer You can

Advertisement