[PHP] Regex help

2005-06-06 Thread RaTT
Hi Guys, I am currently creating a once off text parser for a rather large document that i need to strip out bits of information on certain lines. The line looks something like : "Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221 Website: http://www.urlhere.com E-Mail: [EMA

Re: [PHP] Dynamically loading function arguments

2005-05-31 Thread RaTT
Hi Guys Thanks for your support, i will post the function once done. Regards Jarratt On 5/31/05, Jochem Maas <[EMAIL PROTECTED]> wrote: > RaTT wrote: > > Hi > > > > Currently we are building a basic content management system where we > > would like to be a

[PHP] Dynamically loading function arguments

2005-05-31 Thread RaTT
Hi Currently we are building a basic content management system where we would like to be able to write as libral customized tags as possible, for example [[select:array_name,title]] or [[form:name]] in the format of [[:]] The problem that we are experiencing are that the arguments are being pa

Re: [PHP] Highlighting a stored value as 'selected'

2005-02-08 Thread RaTT
Hello Alp Try something like, 'left', 'center' => 'center', 'right' => 'right'); function drop($array,$sel_name='',$sel_field='',$css=''){ $dropdown = "\n"; foreach($arr as $key => $val){ $sel = ($s

Re: [PHP] How to prevent user directly input SQL query

2005-02-07 Thread RaTT
Hello Thone you can use mysql_real_escape_string() or mysql_real_escape_string() for versions prior to 4.3.0, to aissist with quoting mysql queries, if you use another DB, look at the manual for the relevant escape function. I use this function after just before i insert variables into a sql str

Re: [PHP] cal_days_in_month() missing, how can I tell if it exists

2005-02-01 Thread RaTT
Hi James, http://uk.php.net/manual/en/function.function-exists.php, should help you on your way. hth Jarratt On Tue, 1 Feb 2005 18:57:12 -0600, James Kaufman <[EMAIL PROTECTED]> wrote: > On Tue, Feb 01, 2005 at 08:47:29PM +, Ben Edwards wrote: > > I have been implementing a system on a di

Re: [PHP] Preg_match----------help

2005-01-22 Thread RaTT
Hello, This regular expresion should help you on your way $regex = "/<[A-z_\-]+>?/"; HTH Jarratt On Sat, 22 Jan 2005 17:03:30 +0600, Chandana Bandara <[EMAIL PROTECTED]> wrote: > hi , > > using preg_match , how can i match "<", "_" , ">" " - " such special > characters in a sentence ??? >

Re: [PHP] Re: regular expression help

2005-01-21 Thread RaTT
Hi, >From what i can see you dont even need to call global, as your passing variables to the function ? this could be causing the script to confuse itself. hth On Fri, 21 Jan 2005 09:30:21 -0700, Jason <[EMAIL PROTECTED]> wrote: > Jason wrote: > > Simple functions to check & fix if necessary i

Re: [PHP] Calculate No Of Days

2005-01-03 Thread RaTT
Hi Khuram I use this function function daysLeft($startDate,$endDate=false){ // convert to timestamps $start_stamp = strtotime($startDate); $end_stamp = ($endDate)?strtotime($endDate):time(); if($start_stamp > $end_stamp){

Re: [PHP] Days remaining?

2004-12-03 Thread RaTT
Hi Peter, You can use this function function daysLeft($startDate,$endDate=false){ // convert to timestamps $start_stamp = strtotime($startDate); $end_stamp = ($endDate)?strtotime($endDate):time();

Re: [PHP] How to implement mass emailing?

2004-10-07 Thread RaTT
Hi, you can create a mailscript to run seperartly in the background, so when a administrator wishes to send a mass mail, it writes the content to a database and then executes a stand alone mailing script eg: exec(' php phpmailscript.php > logflile.txt &'); use the & to run the script in the back

[PHP] Retrieving large results from a database ends in memory error.

2004-10-03 Thread RaTT
Hi Guys I am trying to retrieve over 5000 rows from a mysql database, i have to use a "SELECT *" query as i am required to use all the fields for display. Everytime i try to run the code below i get a Allowed memory size of 10485760 bytes exhausted (tried to allocate 40 bytes). Now if i change p

Re: [PHP] Newbie array problem

2004-09-23 Thread RaTT
Hello Try this $array = array(1, 2, 3, 4, 5, 6, 7); $display = implode(';',$array); echo $display; hth Jarratt On Thu, 23 Sep 2004 13:16:03 +0300, Phpu <[EMAIL PROTECTED]> wrote: > If i have an array > $array = array(1, 2, 3, 4, 5, 6, 7) > How can i display the array element sepparated by (;)