htaccess file which redirects my advanced Yii2 app to frontend index.php file for that there is already an .htaccess file. which has following lines.. This is Right Now my .HTACCESS at root directory …
Tag: regex
Regex to allow any language characters in the form of full name and starting with letter
I try to validate a name field, and for this field I like to allow the end user to add anything like Merianos Nikos, Μέριανος Νίκος (greek), or characters from any other language in the same form. The form is first letter capital, rest letters of the word lower, and at least two words. Currectly I have this regex /^([A-Z][a-z]*((s)))+[A-Z][a-z]*$/
Deleting text between two strings in php using preg_replace
I’ve been trying to remove a section of text from a string the sites betweem two tags. For example: This is CROPSTART not very CROPEND cool. …should become this… This is cool. This is the PHP …
Codeigniter is giving me an error called “Disallowed Key Characters.”
I have a input with name=”exam[A+]”. I have figured out that when I called $this->input->post(“exam”) it is giving me an error called “Disallowed Key Characters”. I want to add + sign in my key characters. Here is the code in the system file. How do I change the regular expression to add the + sign in the input? Answer Use
Regex to match a word, even is there are spaces between letters
I’d like to have a regex to match a word, even if there are spaces between the characters. When I want to match the word test, it should match the following: test t est t e s t And so on, but it should not match things like this: tste te ts s tet I have this regex: (t[s]*e[s]*s[s]*t[s]*) But
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
How to redact sensitive substring following a specific substring?
I’ve inherited this script where some sensitive information is stored in the database…and I’m wanting to replace it with ******** before it gets saved and presented in a log. I’m using PHP…and the …
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
Detect partial email pattern in PHP [closed]
I am writing an unsubscribe option of email newsletters. I have to detect emails of following format: <0 or more alphanumeric letter/digit only>, then one <@> character, then <1 or ...
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