Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Did you install it manually or through the package manager?
-
Create a file with the contents: <?php phpinfo(); ?> put it in your document root and then open it (e.g. like http://localhost/phpinfo.php). Then look under "Loaded Configuration File", there it'll say where your php.ini file is.
-
I don't see any problems in the above. If you want it shorter, then you can do: <?php public function print_news() { $news = $this->get_news(null, null, null, 1, "ORDER BY n.date DESC", 15); $html = new html_element("div", false, array("id" => "news")); foreach($news as $news_piece) { $html->add_element(new html_element("div", false, array("class" => "date"), $news_piece['date'])); $html->add_element(new html_element("div", false, array("class" => "title"), $news_piece['title']); $html->add_element(new html_element("div", false, array("class" => "story"), $news_piece['story'])); $html->add_element(new html_element("div", false, array("class" => "author"), "Posted by: {$news_piece['author']} - {$news_piece['time']}")); } $html->print_html(); } ?>
-
You could use the gettext functions. I haven't used them myself before, but these functions are made for internationalization.
-
You can name it (almost) what you want. PHP has reserved some words which you cannot use: http://php.net/reserved That means that <?php class Test { function echo($string) { echo $string; } } $class = new Test(); $class->echo("test"); ?> will result in:
-
If you use implements then you are using interfaces, but if you use extend then you are, well, extending the class, you are making your class a child of the class you are extending (which will be the parent class). Note that you can implement multiple interfaces but you can only extend one class.
-
If you read the stickies, then you would know: http://www.phpfreaks.com/forums/index.php/topic,156753.0.html
-
Difficult problem, regarding syntax however.
Daniel0 replied to matthewhaworth's topic in PHP Coding Help
That should work, yes. -
[quote author=TheFilmGod link=topic=107953.msg685664#msg685664 date=1188578299] I used to be a huge fan of PS2 and the whole playstation. But xbox360 is far the best console in the world. The graphics are really good, just as good as ps3. The ability to go online and play multiplayer with people around the world is incredible. Yesterday I was chatting with a person from oregon! It felt like they were right there!! Seriously that's pretty beastly. I live in NJ. [/quote] I don't own either an Xbox 360 or a PS3, but do I totally miss the point in your post? You say that the graphics in the 360 is as good as in the PS3 and since you (AFAIK) can go online with the PS3 as well, what exactly makes the 360 superior to the PS3?
-
You can escape the double and single quotes easily. All you do is Edit --> Find and Replace --> Find (") Replace (\"). Not hard. I don't see the point of using a heredoc, while escaping the quotes is faster and more effiecient. I don't think it's more efficient? Do you have any sources to verify that? It'll also make your code uglier and harder to read if you have escaped characters in all your strings.
-
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
-
You might try this: document.forms['joe'].elements[fieldname].value = fieldvalue too.
-
Give the field an id instead and do: function setmadeid(obj_id, field_value) { document.getElementById(obj_id).value = field_value document.joe.submit() }
-
That should be quite fine.
-
CLI- reorder array keys after using 'unset'
Daniel0 replied to MelWhetaer's topic in PHP Coding Help
Could you show the code that produces that error? -
CLI- reorder array keys after using 'unset'
Daniel0 replied to MelWhetaer's topic in PHP Coding Help
You might want to use array_shift() to remove the first element. Also, it should be $list = array( 0=>array( 'one', 'two', 'three' ), 1=>array( '001', '2', 'f' ), 2=>array( '002', '3', 'i' ), ); so you use integers instead of strings, but in that case you wouldn't need to specify the key name as it would be automatically given. $list = array( array( 'one', 'two', 'three' ), array( '001', '2', 'f' ), array( '002', '3', 'i' ), ); -
Perhaps you can use this? http://diveintopython.org/regular_expressions/phone_numbers.html
-
I need a PHP based javascript compresser and protector
Daniel0 replied to tibberous's topic in PHP Coding Help
A quick Google search for javascript obfuscator php gave this as the first result: http://www.phpclasses.org/browse/package/1863.html -
You could also use strtotime() to turn it into a UNIX timestamp and then use date() to format it yourself.
-
Nobody here needs help ASAP unless they are posting in the PHP Freelancing forum and are paying people for their time. Your time is in no way more important than the other people who needs help here. You might in fact find that people might be less likely to help you if you state that your problem is "super urgent", "answer needed ASAP" etc.
-
You should probably use matthewhaworth's example if you are going to use the database object in the class (note that you should then not have the $MySQL argument in the method). If you on the other hand only need to use the database object in that specific method then you could do as ahowell did.
-
I don't really get your problem and I don't want to read all that code to find out what might be the problem. You'll have to be more precise.
-
Difficult problem, regarding syntax however.
Daniel0 replied to matthewhaworth's topic in PHP Coding Help
abstract class userFactory { public static function getUser($levelname) { return new $levelname($db); } } -
I don't think that is possible, but I'm not quite sure. You could just try with imagecopyresampled() though.
-
echo $object->var or something like that.