It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data. When you feed a foreach with data that are not an array, you get a warning: Warning: Invalid argument supplied for foreach() in […] Assuming it’s not possible to refactor …
How can we re-use the deleted id from any MySQL-DB table?
How can we re-use the deleted id from any MySQL-DB table? If I want to rollback the deleted ID , can we do it anyhow?
PHP & MySQL Pagination
I have a MySQL query I want to paginate 10 results per page. How Can I do it? Answer Here is a nice starting point:
imagecreatefrompng() Makes a black background instead of transparent?
I make thumbnails using PHP and GD library but my code turn png transparency into a solid black color, Is there a solution to improve my code? this is my php thumbnail maker code: Thank you Answer After imagecreatetruecolor():
Get mime type of external file using cURL and php
I’ve used mime_content_type() and File info but i never successed. i want to use now cURL with PHP and get the headers of the file which is hosted on another domain then extract & determine if the …
What is the “->” PHP operator called? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Closed 4 years ago. Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. What do you call this arrow looking …
preventing direct access to a php page, only access if redirected
I want to make my php page only accessible from another page redirect and prevent my user from accessing it directly. I mean, let’s say I have a page called “main.php” and another PHP file that I want to prevent direct access to, called “noaccess.php”. I want to make noaccess.php…
Can I create a database using PDO in PHP?
I want to create a class which uses PDO to interact with MySQL. Can I create a new MySQL table using PDO?
Get value of input box, without a form?
Does anyone know how I can get the value of an input box, without having a form? I want a submit button, but instead of submitting a form, I want it to change data in a MySQL database. Something like this maybe? Could I use that code on a “onclick” event? The input box’s name and id is ̶…
PHP fetch all Twitter Followers and compare them to friends
I am looking for scalable way to do the following: User login Fetch all Friends from Twitter Fetch all Followers from Twitter Display all Friends which aren’t Followers The Problem: How can this be done in a scalable way? An user can have up to 2 million friends or followers. Currently I’m storing…