Hi,
I haven't yet used preg_match - succesfully,
I tried, but can't figure it out.
I need this
a result is returned from mysql,
I need php to check in that result (sometext_somefile.ext) if this string exists in it '.___' - to check if this text/file has an extension or not. (I cant do it in mysql because of the code it self, I know about like and __)
please if you have a code, and it urgent, i need this or I will manualy check many records and corresponding files
Thanks Ahead !
preg_match I think...
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
<?php
$found = preg_match('#\.___#', file_get_contents($filename));
?>...
Thanks, I'll test it as soon as I write a little even more ugent code 
If I let out file_get_contents
$found = preg_match('#\.___#, )
like this will it work, and further more because I need this matching at the end of the text-srting can I leave out the last #
$found = preg_match('#\.___, )
Thanks Ahead !
If I let out file_get_contents
$found = preg_match('#\.___#, )
like this will it work, and further more because I need this matching at the end of the text-srting can I leave out the last #
$found = preg_match('#\.___, )
Thanks Ahead !