I would like to have a switch statement with both literal cases and cases with a wildcard in the string: Of course the * will be taken literally here cause I define it as a string, so this does not work, but you know what I would like to accomplish: for the A, B and D cases the numbers can
Tag: wildcard
PHP file_exists and wildcard
Is there a way to write the PHP file_exists function so that it searches a directory for a file with an arbitrary extension. For instance, suppose I knew that a file were called “hello”, but I didn’t know the extension, how would I write a function that searched for a file called hello.* and returned the name of this file?
Pattern Match on a Array Key
I need to get the stock values out of this array: I need to pattern match on this array, where the array key = “stock” + 1 wildcard character. I have tried using the array filter function to get every other value on the PHP manual but the empty values seem to throw it out. I tried alot of different