Jump to content

programAngel

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by programAngel

  1. in the following post, I have the code:

    										 				// Also frequently called "Container"				class IoC {				   /**					* @var PDO The connection to the database					*/				   protected $db;				 				   /**					* Create a new instance of Photo and set dependencies.					*/				   public static newPhoto()				   {					  $photo = new Photo;					  $photo->setDB(static::$db);					  // $photo->setConfig();					  // $photo->setResponse();				 					  return $photo;				   }				}				 				$photo = IoC::newPhoto();

    in one of the line it call a function and declare a parameter as static.

    $photo->setDB(static::$db);

    what is the meaning of the static before the name of the parameter, I mean what is the defirrent their code in line 14 and the following code:$photo->setDB($db); because I don't understand what is the meaning of saying somethign is static when you give it as parameter.

  2. Hi,I had a job interview and they asked me about regular expression, I knew most most of the question. However they asked how can I define regular expression that will accept every string that contain equal number of the letter 'a' and 'b', regardless of the other chars.I mean string like:aaabbb (3 - 'a' , a - 'b')afffhgflhgfladflgkdflbdfdsfdsb (2 - 'a', 2 - 'b')avvvbbdda (2 - 'a', 2 - 'b') I told them I know how to create function that will just count the number of 'a' and 'b' and then equate them.but my question is, can I solve it with regular expression and how?

  3. Hi,something confusing me regard the http_get, lets say I want to do the following request:http://example.com?user=bob&password=passwordshould it look like?:Code:$result=http_get("http://www.example.com/", array("user"=>"bob","password"=>"password"), $info);or like:Code:$result=http_get("http://example.com?user=bob&password=password", , $info);I have read the manual:http://php.net/manual/en/function.http-get.php but I am still not sure what the options mean.

×
×
  • Create New...