I'm trying to do a preg_match_all, but it's not matching everything. about 30% gets missed,
here's a sample of the full text that i'm using preg_match_all on...
I'm trying to match everything that's in-between these lines
here's my code...
is there a simple way to convert a friendly date and time to a mysql format
my date and time looks like this...
Tue, 31 Jul 2012 13:17:23 GMT
and i'd like to both split and convert into this...
1. 2012-07-31
2. 13:17:23
this is perhaps one of the simplest things to do, but after googling i just can't find anything that works. Here's my own concoction, which doesn't work.
...so, how would i regex the first line from a block of text
preg_match("#^(.*?)\r\n#is", $content00);
i have a single mysqldump file with quite a few large tables. the file totals about 4.5gb
i would like to load the file (all these tables and their contents) into a mysql database using php
after searching i couldn't really find anything that put me on the right path.
how would go about...
Hi,
I've got a while loop like this....
while ($queryTable01 = mysql_fetch_array($queryTable00)) {
}
if the result is something like this...
1
2
3
4
5
6
how would i get the second to last result being... '5' ?
is there a way to calculate ratios within a mysql query?
for example if i have 2 columns in the same table
column A = 10
column B = 2
then the ratio is 5:1
I normally do this using php but i'd now prefer to simplify things by doing as much as i can in the query
i'm trying to generate a nonce code from php. surpisingly there's very little that i found when searching google
i've found this site that generates the nonce for you using js... http://www.teria.com/~koseki/tools/wssegen/
the way it works i insert my username and password
then select auto for...
I'm getting this error message...
line 428 has this line of code...
$lines = file($Cdir.$file_names[$i]);
what the code does...
1. reads a csv file
2. if it detects the word 'copyright' it then removes the first 15 lines
... it does this by copying the whole file content then writing the...
I have a bit of regex code....
preg_match('#(?P<month>\w+) (?P<day>\d+) (?P<year>\d+)#', $dataAB[0], $haveDate0);
for dates that are formatted as for example, Aug 14, 2010, it will output...
$haveDate0[year]
$haveDate0[month]
$haveDate0[day]
but if the date is formatted as Aug 4, 2010...
i can select records 1- 10 using...
GROUP BY x
ORDER BY x DESC
LIMIT 10
and i can select a specifc range of records...
GROUP BY x
ORDER BY x DESC
LIMIT 10,15
but what i can't figure out are two things....
1) selecting records from 10 to the last row
i can do it by saying LIMIT 10,10000000
but...
i've just finished writing an app and i would like to protect it by using encryption.
i've googled 'php encrypt code', but thought it'd be better if i asked the question here as you guys would have a good amount of experience with encrypting you work.
what would be my best approach?
is there...
i'm trying to format a date for mysql
the date is is currently 20100201 but i'd like to format it as 2010-02-01, separated with hyphens
what would be the ideal regex code to do this?
if i have a string like this...
a bit of text here, and a bit of text there, and some more, just here
what regex would i use to remove the last comma? there could be any amount of commas (i wouldn't know how many), but i would like to remove (replace) the last one.
i've been following tutorials by the letter, but can't get my curl login script to work
do you see something that i might be doing incorrect?
$loginPage = 'http://www.test_page_login.com';
$useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204...
i'm trying to copy a file from one directory to another
here's my script so far...
$path_source = ''.$_SERVER[DOCUMENT_ROOT].'/folder/original/';
$path_destination = ''.$_SERVER[DOCUMENT_ROOT].'/folder/new/';
$file = ''.$path_source.'image.jpg';
copy($file, $path_destination);
but i get...
just a little advise needed...
from now on, when i develop sites for others i will no longer plug their sites into my own cms. to reduce headache i want to provide clients with total ownership by using an open source cms installed on their own server.
can anyone give advice on what is the...
ok, here's another little problem that i have....
there are three types of numbers i'm trying to match...
07912123456
07912 123456
07912-123456
here's my regex...
'#([0-9]{10,14})|([0-9]{5})\s([0-9]{4,7})#'
([0-9]{10,14}) works fine for this number format 07912123456
but for the other...
hi, im trying to match a line of text
from the code below i want to match this line...
var addy_text8756 = 'monique' + '@' + 'croydonebonyescort' + '.' + 'co' + '.' + 'uk';
i've tried using this preg_match '#var...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.