Gossamer Forum
Home : General : Internet Technologies :

ereg_replace() in PHP - stupid errors!

Quote Reply
ereg_replace() in PHP - stupid errors!
I have just been writing a new user account interface in PHP, and I tried the following;

Code:
$line = ereg_replace(":::closed_tickets:::",$closed_tickets, $line);

I noticed that it was replacing :::closed_tickets::: with a blank (i.e nothing). After a bit more debugging (working out if the values were actually being set in the script), I had a random idea to quote the variable... i.e so it looks like this;

Code:
$line = ereg_replace(":::closed_tickets:::","$closed_tickets", $line);

Note the quotes around $close_tickets.

Just thought I would post this handy thing to know... it had me baffled for a couple of hours :(

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates