I get this, when I try to run my PHP.
When I comment out the database execute() method it is going without errors. But this is not helping me a lot. Please Help :-)
PHP treats all arrays as associative, so there aren't any built in functions. Can anyone recommend a fairly efficient way to check if an array contains only numeric keys?
Basically, I want to be able to differentiate between this:
$sequentialArray = array('apple', 'orange', 'tomato', 'carrot');
and this:
$assocArray = array('fruit1' => 'apple',
'fruit2' => 'orange',
'veg1' => 'tomato',
'veg2' => 'carrot');
I'm using a pre-commit hook to lint-check PHP source submitted by our staff, and everyone's really happy with the results. The staff have agreed it would be useful to have the code re-formatted to follow (customizable) style rules on commit. Are there any FOSS scripts which can do this from the command-line?
Hello! How to find a speciefic nearest day of the week in PHP if initially I have a date string like: 07.05.2010? For example, I want to find the nearest Sunday (or any day of the week). How can I implement this? Thanks
Conceptually speaking how would one go about writing an achievement system for a website using PHP and MySQL?
Is the only real way of doing it is to constantly do MySQL queries to test for achievements and such?
In php 5, all variable and objects are passed by reference, but i can't get my codes work
My codes is:
$arrayA = array();
$array = $arrayA;
...
if(!in_array(thedata, $array) // if i use & to get ref, got an error here, should i use *$array here?
$array[] = thedata;
var_dump($arrayA);
The result is empty, am i missing something simple?
I have two Zend Date objects to work with:
$now = Zend_Date::now();
$sessionStart = new Zend_Date('2010-04-01 10:00:00', 'yyyy-MM-dd HH:mm:ss');
I need to calculate the time remaining and display in a human readable manner.
The session will begin in 7 days.
The session will begin in 30 minutes.
How can I do this with PHP and the Zend Framework?
I have this line of PHP code:
thisFunctionDoesNotExist();
And it stops script execution with:
Fatal error: Call to undefined function
I tried using set_error_handler and it does help for warning type of errors. But not for fatal errors. As I understand it from various threads on internet it should be possible to handle by set_error_handler, but I cannot make it work.
Can you please post working example?
how can i decrypt password string in php which is crypt
$salt = substr($_POST['password'], 0, 2);
$password = crypt($_POST['password'], $salt);
i need to send the password in email "forgetpassword"
I understand that I can set the option on any specific instance, however what I would really like is to set something up php.ini or somewhere similar which will handle this across all projects and all instances.
Does anyone know a way for me to accomplish this?
When users input their images, their images are any size. I want to be able to resize all the images to a specific dimension. Is there a function that allows me to do that in PHP?
thanks
can any one please let me know is there any way to grab a screen shot of a web page when we pass the URL as parameter. I have a requirement to capture a screen shot of that page when posting a blog.
This i need in php script.
Hi,
I have a common script which Im including in my php cron files and the files which are accessing through the browser. Some part of the code, I need only for non cron files. How can I detect whether the execution is from CLI or through browser (I know it can be done by passing some arguments with the cron files but I dont have access to crontab). Is there any other way ?
Regards
Binoy
I guess if it is possible, that it will be some crazy convoluted way, but my client has asked me to try to create a log file of people who log in to the site.
Is there a way to do this? I don't know php/smarty so well, I'm more of a layout person.
Thanks.
I am using a multidimensional array and I am trying to use php to find the last value of one of the arrays and based on that last number(value), add one more to it.
Here is my multidimensional array structure:
$_SESSION['cart']['add_complete'][1]['deck_id']
I am trying to create this structure, but instead of where it says 1 now, I want to find out what the last number in the add_complete array is and then add one more to it and put that in the place of the 1. How can I do that?
here's a definition of marshaling from Wikipedia:
In computer science, marshalling
(similar to serialization) is the
process of transforming the memory
representation of an object to a data
format suitable for storage or
transmission. It is typically used
when data must be moved between
different parts of a computer program
or from one program to another.
I have always done data serialization in php via its serialize function, usually on objects or arrays. But how is wikipedia's definition of marshaling/serialization takes place in this serizalize() function?
Just wondering if there are any good tutorials on PHP/MySQL on the web that's free. I looked at youtube and the tutorials they have there are a bit too easy.
Where can I find tutorials about creating a social network (like db structure, sql query samples eg.) using PHP & MySQL ? I do not need a ready script, I just want to learn how to do it..
What sort ort of programming paradigm (sockets,RPC,Web services,Distributed objects middleware) is usually used between web server and application server in PHP n-tier architecture?Whats the difference of using DOM or Web services for this purpose?
Hi,
As far as I know when writing a conditional statement in C such as the following:
if ( some_function() == 100 && my_var
== 5 ) { //do something }
is slower to execute than
if ( my_var == 5 && some_function() ==
100 ) { //do something }
because it's faster to execute the my_var == 5 rather than all of the code in the function ( because if my_var != 5, then the rest of the if statement would not even be executed )...so I am wondering if the same is true for conditional statements in PHP?
How a programming call is usually made between web server and application server in a PHP n-tier architecture when the servers are on separate machines in the network?Whats the difference of using DOM(Distributed object middleware) or Web services for this purpose?
In my php application, I'm using $_SESSION to track whether a user is logged in. If a user leaves any page on my site at http://mysite.com and goes to http://someotherwebsite.com, I want to automatically log them out, such that if they return to any page on http://mysite.com, they need to login again.
Is there an easy way to do this?