2108 solutions found
Page 24 of 106votes
If I define an array in PHP such as (I don't define its size): <!-- language: lang-php --> $cart = array(); Do I simply add elements to i...
votes
Is there a function to make a copy of a PHP array to another? I have been burned a few times trying to copy PHP arrays. I want to copy an array defined insid...
votes
Does anyone have a `T_PAAMAYIM_NEKUDOTAYIM`?
votes
Quite often I will try and run a PHP script and just get a blank screen back. No error message; just an empty screen. The cause might have been a simple syntax...
votes
Is there a way to convert an integer to a string in PHP?
votes
`players ` will either be empty or a comma separated list (or a single value). What is the easiest way to check if it's empty? I'm assuming I can do so...
votes
I have seen uses of `@` in front of certain functions, like the following: $fileHandle = @fopen($fileName, $writeAttributes); What is the use of this...
votes
I'm curious to know if it's possible to bind an array of values to a placeholder using PDO. The use case here is attempting to pass an array of values...
votes
Can anyone show me how to do a PHP cURL with an HTTP POST? I want to send data like this: username=user1, password=passuser1, gender=1 To `www.exam...
votes
Is there a standard way of passing an array through a query string? To be clear, I have a query string with multiple values, one of which would be an array...
votes
How can I insert a new item into an array on any position, for example in the middle of array?
votes
The question is simple. I have a `foreach` loop in my code: foreach($array as $element) { //code } In this loop, I want to react differe...
votes
I would like to create helper functions to avoid repeating code between views in Laravel. For example: *view.blade.php* <p>Foo Formated text: {{...
votes
Given this array: $inventory = array( array("type"=>"fruit", "price"=>3.50), array("type&q...
votes
I want to read a file line by line, but without completely loading it in memory. My file is too large to open in memory, and if try to do so I always get out...
votes
What are the differences between `htmlspecialchars()` and `htmlentities()`. When should I use one or the other?
votes
I have a website hosted on a PC I have no access to. I have an upload form allowing people to upload mp3 files up to 30MB big. My server side script is done in...
votes
I can use `set_error_handler()` to catch most PHP errors, but it doesn't work for fatal (`E_ERROR`) errors, such as calling a function that doesn't exis...
votes
I am converting a PHP 5.3 library to work on PHP 5.2. The main thing standing in my way is the use of late static binding like `return new static($options);` ,...
votes
I'm using the Laravel Eloquent query builder and I have a query where I want a `WHERE` clause on multiple conditions. It works, but it's not elegant....