Regex for individual words in php

Regex for individual words in php

This is a simple check for words that you might want to check if the given string is this word or that word. Possible utilization could be: when you allow the user to upload file, you might want to get only certain type of file only like in the case of image jpeg, jpg, and gif only

if (preg_match('/jpeg|jpg|gif/i')){
   //do uploading
}else{
    $message = "supported file types are ...";
}

See how you would solve these known algorithm problems

binary tree problems with solution

Flatten nested javascript array

Implementing tokenizer and adding tokens to the linked list

Find the first occurence of number in the sorted array

Changing decimal number to its binary equivalent

find longest word in the sentence

Get maximum occurring character

Java solution for checking anagram strings – tell if phrases are anagrams

Array reversal in Recurrsion

Find K Complementary numbers from array Java implementation

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*