[Solved] Automatic Copyright Footer Dates in Laravel/Basically Vanilla PHP
Answers in Server-Side | By August R. Garcia
Published | Last Update
The only part about this that isn't vani...
MoreThe only part about this that isn't vanilla PHP is using {{ $var }} as shorthand for <?= htmlspecialchars($var); ?>. <style> .footer...[Solved] Favicon.ico Files not Caching on Chrome
Answers in Server-Side | By August R. Garcia
Published | Last Update
Slash "solved."Truly a quality hack.
MoreAs discussed previously, there are a fair number of dumbass things that can be done with base64 encoding that are occasionally so dumb that they even...[Solved] PHP/Laravel - Cache Query for Current Request/Pageload
Answers in Server-Side | By August R. Garcia
Published
TL;DR: Use $GLOBALS
MoreThe Laravel caching functions seem to not have specific built-in functionality to cache a query for only the current pageload, but it can easily be do...How do I solve "Cannot use object of type stdclass as array"?
Answers in Server-Side | By Some Guy
Published
Last ReplyWhen we use json_decode();, we get an object of type stdClass as return type. 1. Cast the object to array. This can be achieved as follows.... Univa,
When we use json_decode()...
Last ReplyIt will merge two arrays and combine their items in a single array. Example Code - $existing_array = array('a'=>'b', 'b'=>'c'); $new_arra... Univa,
It will merge two arrays...
Fixing "linting is disabled for this query because it exceeds the maximum length PHPmyadmin?"
Answers in Server-Side | By Some Guy
Published

Last ReplyLinting is a term for a program to analyze code for potential errors. This just means the query can't be validated but IIRC you can still ru... JJJJJ,
Linting is a term for a p...
Solve "Connection for controluser as defined in your configuration failed"?
Answers in Server-Side | By Some Guy
Published
Last ReplyLog in as root in phpMyAdmin Create a database called PHPMyAdmin Create a user called pma and set the "host" to the hostname or IP address... Univa,
[SOLVED] How to use PHP and cURL to make requests to the PayPal REST API
Answers in Server-Side | By August R. Garcia
Published
Last ReplyAlso, this tool is fairly useful: https://incarnate.github.io/curl-to-php/ Some Guy,
Also, this tool is fairly...
[SOLVED] How to get an OAuth Access Token for the PayPal REST API (Using cURL with PHP)
Answers in Server-Side | By August R. Garcia
Published
For "Authorization: Bearer "
MoreThe PHP Function <?php // This function makes the equivalent of the cURL call below: // curl -v<200b> https://api.sandbox.paypal.com/v...PHP Fatal error: Can't use function return value in write context in [Some File Path]
Answers in Server-Side | By Some Guy
Published
Last ReplyThis line: unset( $recent($key) ); Should be: unset( $recent[$key] ); August R. Garcia,
This line:
Fix "Port 80 in use by "unable to open process" with pid 4!"?
Answers in Server-Side | By Some Guy
Published
Last ReplySome of the program that may be using Port 80: Skype: Skype uses port 80/443 by default. Go to tools >options > advanced >conn... Univa,
Some of the program that...
How to write "correct horse battery staple" passwords in PHP?
Answers in Server-Side | By Some Guy
Published
Last Replyfunction correct_horse_battery_staple() { // The file that contains the words you want to use $f_contents = file(public_path() .... August R. Garcia,
Last ReplyAlso, if you're running out of memory, note that for shared hosting and VPS setups, MySQL runs on a separate machine/partition from your website's fil... August R. Garcia,
Also, if you're running o...
How do I make create greentext (4chan style) using the PHP DOMDocument library?
Answers in Server-Side | By Some Guy
Published
Last ReplySomething like this should work: function greentext(DOMDocument $xml_doc) { // Get all P tags $nodes = $xml_doc->getElementsBy... August R. Garcia,
Something like this shoul...
Last ReplyThere is also some code in this article that does this: https://www.256kilobytes.com/content/show/3104/php-how-to-configure-a-website-to-show-jump-... August R. Garcia,
There is also some code i...
Last ReplyPHP documentation for arsort(): http://php.net/manual/en/function.arsort.php Also, there are a few other array sorting options: sort() -... August R. Garcia,
PHP documentation for ars...
Last ReplyYou can also directly run these commands through the PHPMyAdmin UI: SHOW DATABASES; If you need to look up the database name(s) DROP... August R. Garcia,
You can also directly run...
Getting error "the mbstring extension is missing. please check your PHP configuration?"
Answers in Server-Side | By Some Guy
Published
Last ReplyFirst of all, make sure you restart Apache (server) after you have modified the php.ini. Also, ensure that the file that's causing this error to pop u... roxblade,
First of all, make sure y...
Last ReplyBefore PHP 5.2, you will need to define a custom sorting function to do that. Let's say it goes like this: function sortByOrder($a, $b) { re... roxblade,
Before PHP 5.2, you will...
How to solve the error "php_network_getaddresses: getaddrinfo failed: name or service not known?"
Answers in Server-Side | By Some Guy
Published
Last ReplyThis is most probably happening because DNS lookup is failing. If you're particularly sure that the server is accessible and you can open it otherwise... roxblade,
This is most probably hap...
Last ReplyUse the setTimezone function for this. This works from PHP 5 up until the latest version. DateTime::setTimezone -- date_timezone_set This w... roxblade,
Use the setTimezone funct...
How to remove/rewrite all "index.php" strings in a URL using .htaccess?
Answers in Server-Side | By Some Guy
Published
Last ReplyIt's simple. Add the following code to your .htaccess file and all .index.php will be removed from your URLs. <IfModule mod_rewrite.c>... roxblade,
It's simple. Add the foll...
How to escape user input for an HTML input's "value" attribute?
Answers in Server-Side | By Some Guy
Published
Last ReplyNote that if you're talking about an attribute, by default htmlspecialchars() does not encode the single quote ( ' ) chara... August R. Garcia,
Note that if you're t...
Last ReplyIn PHP there are two types of array, indexed and associative. Which one is best for you depends on what you're doing. Indexed Arrays Thes... Hash Brown,
In PHP there are two type...
[PHP] Is it possible to get the next item's value in a PHP foreach loop?
Answers in Server-Side | By Some Guy
Published
Last ReplyHello, If your array keys are continuous, it's very simple to do. foreach ($arr as $key => $val) { if (isset($arr[$key+1])) {... Hash Brown,
Hello,
Last ReplyHello, There is no function that will do this but it's pretty easily done using lists and arrays list($a,$b) = array($b,$a); Learn mo... Hash Brown,
Hello,
Last ReplyThis is fairly simple homie. A basic solution of this would be to explode the string on spaces to turn the string into an array of words. We can... Hash Brown,
This is fairly simple hom...
Last ReplyThis is more a maths thing than anything else. If you have the decimal (0 to 1) and want to turn it into a percentage you simply multiply by 100.... Hash Brown,
This is more a maths thin...
Is PHP's echo shorthand (<?= 'Some String'; ?>) standard/safe? Or should I disable short_open_tag?
Answers in Server-Side | By Some Guy
Published
Last ReplyAnd just to follow on PHP is pretty retarded. Making your code work with the least number of changes you have to make to php.ini the better. Hash Brown,
And just to follow on