Jump to content


.josh

Member Since 31 Dec 1969
Offline Last Active Dec 15 2014 08:03 PM

Posts I've Made

In Topic: Ask for a simple regexp question!

23 November 2014 - 12:10 PM

That's what the manual entry says, and it seems to say that clearly. . are you looking for confirmation that the manual is right, or am I missing what you're really asking?


In Topic: preg_match

26 October 2014 - 11:02 AM

I see a number of issues with your regex, for example, one problem I see is that your patterns aren't accounting for newlines and whitespace between html tags.  But rather than try to make your regex work, you instead use a DOM parser for this.  


In Topic: How to load a PHP class into a PHP functions

25 October 2014 - 09:11 AM

include_once"database.php";
 
function test($one, $two, $three, Database $database)
{
   $database->query(...); /// doesn't work inside this function
}
 
$database->query(...); /// works outside the function

 

 

So, some debugging 101 here.. you got an error that was essentially the result the variable not being within the scope of the function. So you updated your function declaration and now you are getting another error, which basically means you aren't passing to test what it expects.  To me, this sounds like you likely essentially have the same issue before, except backing up the chain a notch.  

 

So, where/how are you calling test()?  Did you update where you are calling it to have it actually pass a Database type object when you call it?  If so, are you calling test() within some other function, and $database isn't exposed to it, in the same way it wasn't exposed here?

 

Follow the trail, make sure $database is actually exposed, same as you already did here. 


In Topic: Complex regular expression

07 October 2014 - 10:25 PM

Good lord you never give up do you.  It must be tiring being you. 


In Topic: Complex regular expression

03 October 2014 - 06:18 PM

I gave a random example to make a point that you don't know what the context is.  Instead, you deliberately try to sidestep the point in a vain attempt to try and tear me down.  You really do have issues man.  As far as everybody in this community is concerned, you are the unwanted troll, and you know it


Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com