378 solutions found in general-dev
Page 4 of 19votes
I have a line like this in my CSV: `"Samsung U600 24"","10000003409","1","10000003427"` Quote next to `24` is...
votes
I have searched on the web for over two days now, and probably have looked through most of the online documented scenarios and workarounds, but nothing worked f...
votes
It seems that PHP has two memcached libraries named [memcache][1] and [memcached][2]. What is the difference and how do you know which one to use? Is one outdat...
votes
I'm reading out lots of texts from various RSS feeds and inserting them into my database. Of course, there are several different character encodings used...
votes
// Other variables $MAX_FILENAME_LENGTH = 260; $file_name = $_FILES[$upload_name]['name']; //echo "testing-".$file_name.&qu...
votes
I wonder, what's the easiest way to delete a directory with all its files in it? I'm using `rmdir(PATH . '/' . $value);` to delete a folder,...
votes
What construct should I use to check whether a value is NULL in a Twig template?
votes
I am just getting a grasp on the MVC framework and I often wonder how much code should go in the model. I tend to have a data access class that has methods like...
votes
How can I get the last day of the month in PHP? Given: $a_date = "2009-11-23" I want 2009-11-30; and given $a_date = "2009-12...
votes
In PHP I am trying to create a newline character: echo $clientid; echo ' '; echo $lastname; echo ' '; echo '\r\n&...
votes
I am downloading a JSON file from an online source and and when it runs through the loop I am getting this error: > Fatal error: Maximum execution time of...
votes
**UPDATE 2:** I have now removed the following from the .php file: <?php error_reporting( E_ALL ); ?> I have set display_erros in php.ini as...
votes
I would think the following piece of code should work, but it doesn't **(Edited: Now works in PHP 5.5+)**: if (!empty($r->getError())) Where `g...
votes
I'm trying to use the `Artisan` command like this: php artisan serve It displays: > Laravel development server started: <http://127.0.0.1...
votes
What is the difference between [`PDOStatement::bindParam()`][1] and [`PDOStatement::bindValue()`][2]? [1]: http://www.php.net/manual/en/pdostatement.bind...
votes
I have a string returned to one of my views, like this: $text = '<p><strong>Lorem</strong> ipsum dolor <img src="images/tes...
votes
<?php for ($i = 'a'; $i <= 'z'; $i++) echo "$i\n"; This snippet gives the following output (newlines are re...
votes
I need to catch some warnings being thrown from some php native functions and then handle them. Specifically: array dns_get_record ( string $hostname...
votes
If I want to create a URL using a variable I have two choices to encode the string. `urlencode()` and `rawurlencode()`. What exactly are the differences and...
votes
I want a version of `str_replace()` that only replaces the first occurrence of `$search` in the `$subject`. Is there an easy solution to this, or do I need a ha...