In PHP5, what is the difference between using self and $this ? When is each appropriate?
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Friday, May 25, 2012
PHP: self vs. $this
Wednesday, May 16, 2012
How do I pick only the first few items in an array?
Here's something simple for someone to answer for me. I've tried searching but I don't know what I'm looking for really.
Tuesday, May 15, 2012
Symfony2 Twig extension
I have some problem to implement twig extension. I need to create my own filter (a substr filter). So I have thought to use twig extension.
Wednesday, May 9, 2012
PHP weird Seg-faults on mysqli_stmt_bind_result
When migrating a PHP script from PHP 5.2 to PHP 5.3, I've stumbled to the following problem: The general purpose of the script is data mining. I have a procedure inside that adds data to the MySQL server. Since it is really repetitive, I've rewritten it (a while ago) to use MySQLi, in particular prepared statements, since there are a total of 3 possible queries to perform. Anyway, now, on the PHP 5.3 server, the script is crashing on the following line:
Is it bad to declare an empty class?
In my spare time, I am building a Sudoku solver to try to get the hang of OOP in PHP. A Sudoku puzzle, for those of you who don't know, is in its most common form a 9x9 matrix of numbers from 1 to 9, with 3x3 squares delineated in a tic-tac-toe like pattern. Some numbers are filled in in advance. The goal of the puzzle is to fill in the remaining numbers, so that no row, column or 3x3 square contains the same number more than once.
what is APC internal debugging?
I got a prompt with Enable internal debugging in APC [no]: . While installing APC.
Friday, May 4, 2012
Scaling a chat app - short polling vs. long polling (AJAX, PHP)
I run a website where users can chat with each other through the browser (think Facebook chat). What is the best way to handle the live interaction? (Right now I have a poll going every 30 seconds to update online users and new incoming messages, and another poll going on chat pages every second to get new messages.)
PHP - MVC framework?
I am just starting out in the PHP world. I have used asp.net mvc and come from a VS 2008 background..
Split a sentence into separate words
I need to split a Chinese sentence into separate words. The problem with Chinese is that there are no spaces. For example, the sentence may look like: 主楼怎么走 (with spaces it would be: 主楼 怎么 走 ).
How do I CURL www.google.com - it keeps redirecting me to .co.uk
I am using CURL to check for the existence of a URL (HEAD request) but when I test it with www.google.com , it redirects me to www.google.co.uk - probably because my server is UK-based.
Getting ’ instead of an apostrophe(") in PHP
I'v tried converting the text to or from utf8… didn't seem to help
Monday, April 23, 2012
SQL injection that gets around mysql_real_escape_string()
Is there an SQL injection possibility even when using mysql_real_escape_string() function?
Friday, April 6, 2012
ACL implementation
First question
Please, could you explain me how simpliest ACL could be implemented in MVC.
Wednesday, March 7, 2012
Zend_Gdata and OAuth
I successfully retrieved token key / secret after applying Google Hybrid Protocol (OpenID + OAuth).
Why can"t I declare a function name "_”?
Code:
function _()
{
echo 'hello word';
}
Monday, March 5, 2012
Send data from android to mysql using php
I have a some text on an android client, I want to send it to the database(MySQL). How do I do this.Please help me with this. I tried using php and Mysql. Is the query in Php right??
Send data from android to mysql using php
I have a some text on an android client, I want to send it to the database(MySQL). How do I do this.Please help me with this. I tried using php and Mysql. Is the query in Php right??
Monday, February 20, 2012
How can i create a new tab in myaccount page using custom module in drupal
How can i create a new tab in myaccount page using custom module in drupal.Is there any hooks for that?
Tuesday, February 14, 2012
Escaping quotes - moving from PHP4 to PHP5
I've inherited a php4 site that needs to run on my PHP5 Server, I've solved most of the issues but can't figure out what the author was trying to do here. Well, to be precise, he was tring to quote the submitted text but I'm not sure how this function is supposed to work and how I should do it in PHP5?
Friday, February 10, 2012
Behaviour of glob function in php is different with open_basedir
I migrate from sugar 5.2 to sugar crm 6.2 and i'm using open_basedir and it doesn't work ...