Skip to content
Advertisement

Tag: string-matching

PHP Query – Check string character

Above code is working where it able to check if the “variable” is starting with ‘ax’, but what if i wanted to check “multiple” different validation ? for example : ‘ax’,’ab’,’ac’ ? Without creating multiple if statement Answer You can use array to store your keywords and then use in_array() if you want to avoid multiple if statements. References: in_array

Advertisement