Jump to content

slimboy007

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

slimboy007's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. doh this is a forum ain't it for help for people who are stuck or just learning php so what does it matter? but thank you for the help appreciate it
  2. how can i get a list of filename and filepaths with the extension '.png' in the following directory structure, advanced solution should allow further files and directories to be added at any point in the tree: /* - folder - test1.png - test2.png - untitled.txt - subfolder - test3.png - untitled1.txt */
  3. How can i finish the following class to print "Person->name is only human" when the following is executed on a Person object: print $person; class Person{ private $name = ''; public function __construct($name){ $this->name = $name; } } $person = new Person('Andrew'); print $person; // Andrew is only human
  4. i am trying to create a function to replace all instances of 'sam' with 'paul' within the values of the following array. can someone give me a bit of a hand? $name = array('key1'=>'sam1', 'key2'=>'value2', 'key3'=>array('sam','sam1','sam2')); $str1 = “sam"; $str2 = “paul”; foreach ($name as $value) { if($value == $str1){ $value = $str2;} }
  5. how can i extract and add together the numeric values from the string $numbers $numbers = '{"val_a":7,"val_b":5,"val_c":4,"val_d":6,"val_e":5}';
  6. I have a question which i am not sure how to answer can anyone help please? Using PHP, determine whether the method 'simple_sum' exists in the class Exam. class Exam{ public function simple_sum(){ return null; } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.