I know that when I set CURLOPT_FOLLOWLOCATION to true, cURL will follow the Location header and redirect to new page. But is it possible only to get header of the new page without actually redirecting …
Search for highest key/index in an array
How can I get the highest key/index in an array with php? I know how to do it for the values. E.g.: from this array I would like to get 10 as an integer value: I know how I could code it but I was asking myself if there is a function for this as well. Answer This should work
Page redirect after certain time PHP
There is a certain PHP function for redirecting after some time. I saw it somewhere but can’t remember. It’s like the gmail redirection after logging in. Please, could anyone remind me? Answer this is the php way to set header which will redirect you to wherever.php in 5 seconds Remember that head…
Whats the difference between {$var} and $var?
I would like to know when and why should I use {$var} and when (and why) should I use the simple form $var Answer You would use the latter when a) not accessing an object or array for the value, and b) no characters follow the variable name that could possibly be interpreted as part of it.
echo MySql column names and values
What I need is to have a list name => value to be able to make MySql queries. My problem is, I can access MySql records, but I also need to access table’s column names, what should I change in my code? Thanks ok, so now why can’t I join the values to then make my sql queries? I just
Parallel processing in PHP – How do you do it?
I am currently trying to implement a job queue in php. The queue will then be processed as a batch job and should be able to process some jobs in parallel. I already did some research and found several ways to implement it, but I am not really aware of their advantages and disadvantages. E.g. doing the parall…
What does the ‘period’ character (.) mean if used in the middle of a PHP string?
Here is some example code: What does the period character do in the middle of each piece of the string? For example, Answer This operator is used to combine strings. EDIT Well, to be more specific if a value is not a string, it has to be converted to one. See Converting to a string for a bit more detail.
Generating a random password in php
I am trying to generate a random password in php. However I am getting all ‘a’s and the return type is of type array and I would like it to be a string. Any ideas on how to correct the code? Thanks….
Switch statement in PHP injected HTML
It’s 1! I want to do something like that, in other words use the switch statement in PHP templates. This …
Does php5.3 support mysqli extension without any additional manual configurations/updates?
I’ve built a PHP based website with MySQL as the back-end, and am planning to put it online now. The issue is that I’ve used mysqli extension in the PHP scripts extensively, and right now I’m worried …