256 Kilobytes

Web Development > PHP

Type All Category Web DevelopmentContent about developing websites, web applications, and other similar projects. Tag PHPPHP: Hypertext Preprocessor is a scripting language used heavily in server-side development. PHP is frequently used for templating.

Profile Photo - August R. Garcia

[Solved] Automatic Copyright Footer Dates in Laravel/Basically Vanilla PHP

Answers in Server-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

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...
🗨 0
🐏 0
👁 512
Profile Photo - August R. Garcia

[Solved] Favicon.ico Files not Caching on Chrome

Answers in Server-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

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...
🗨 0
🐏 1
👁 312
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

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...
🗨 0
🐏 0
👁 438
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Call the currentPage and lastPage method...

MoreIncorrect: <h1>Page {{ $paginator->currentPage }} of {{ $paginator->lastPage }}</h1> Correct: <h1>Page {{ $pagina...
🗨 0
🐏 0
👁 1,905
Profile Photo - August R. Garcia

[PHP] How to Add rel="nofollow", rel="nofollow ugc", rel="nofollow sponsored" and/or Other rel Attributes to Links

Articles in Server-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyAhrefs now shows/lists data related to the rel="ugc" and rel="sponosored" attribute values. See newly added cover image to this post. August R. Garcia,

Ahrefs now shows/lists da...

Tue, 08 Oct 2019 07:01:36 -07001 year ago1
🗨 1
🐏 1
👁 1,784
Profile Photo - August R. Garcia

[Solved] Adding an "active" class to

Answers in Client-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

Basically the same with PHP in general;...

MoreBasically the same with PHP in general; only real difference is the use of Route::currentRouteName(). Code: <nav> <?php $...
🗨 0
🐏 0
👁 353
Profile Photo - Some Guy
Profile Photo - Default

Last ReplyAnother approach is a prototype based solution. Node.prototype.getElementsByTagNames = function (tags) { var elements = []; for (... Ali,

Another approach is a pro...

Wed, 29 May 2019 05:05:53 -07002 years ago1
🗨 2
🐏 0
👁 485
Profile Photo - Some Guy

How do I solve "Cannot use object of type stdclass as array"?

Answers in Server-Side | By Some Guy

Published

Profile Photo - Univa

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()...

Wed, 08 May 2019 08:38:04 -07002 years ago1
🗨 1
🐏 0
👁 541
Profile Photo - Some Guy

[PHP] Push to associative array?

Answers in Server-Side | By Some Guy

Published

Profile Photo - Univa

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...

Wed, 08 May 2019 08:16:57 -07002 years ago1
🗨 1
🐏 0
👁 471
Profile Photo - Some Guy
Profile Photo - Univa

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,

Wed, 24 Apr 2019 08:13:19 -07002 years ago1
🗨 1
🐏 0
👁 556
Profile Photo - August R. Garcia
Profile Photo - Some Guy

Last ReplyAlso, this tool is fairly useful: https://incarnate.github.io/curl-to-php/ Some Guy,

Also, this tool is fairly...

Sun, 14 Apr 2019 03:35:46 -07002 years ago1
🗨 1
🐏 0
👁 533
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

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...
🗨 0
🐏 0
👁 469
Profile Photo - August R. Garcia

[Solved] PayPal REST API AUTHORIZATION_ERROR on sandbox.paypal.com when sending invoices

Answers in Web Development | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

Full Error:

MoreFull Error: { "name": "AUTHORIZATION_ERROR", "message": "Authorization error occurred.", "information_link": "https://...
🗨 0
🐏 0
👁 518
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last ReplyThis line: unset( $recent($key) );  Should be: unset( $recent[$key] );  August R. Garcia,

This line:

Sun, 07 Apr 2019 12:10:37 -07002 years ago1
🗨 2
🐏 0
👁 519
Profile Photo - Some Guy
Profile Photo - Zhaybib

Last ReplySince you say that you want to learn how to use the WordPress function of wp_enqueue_style(), I recommend that you check out Stack Overflow's discussi... Zhaybib,

Since you say that you wa...

Sat, 30 Mar 2019 15:17:54 -07002 years ago1
🗨 1
🐏 0
👁 408
Profile Photo - bugblocker

How to get the current page URL in WordPress (PHP)?

Answers in Web Development | By bugblocker

Published

Profile Photo - KacssPL

Last ReplyYou can use the following code to obtain the current URL in wordpress: global $wp; $current_url = home_url(add_query_arg(array(), $wp->request));. Thi... KacssPL,

You can use the following...

Sat, 30 Mar 2019 15:05:45 -07002 years ago1
🗨 1
🐏 0
👁 298
Profile Photo - Some Guy

Fix "Port 80 in use by "unable to open process" with pid 4!"?

Answers in Server-Side | By Some Guy

Published

Profile Photo - Univa

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...

Thu, 28 Mar 2019 11:56:18 -07002 years ago1
🗨 1
🐏 0
👁 546
Profile Photo - pls_stop_this

PHP parse error: syntax error, unexpected end of file?

Answers in Web Development | By pls_stop_this

Published

Profile Photo - ABCDCBA

Last ReplyThere is no easy solution unless you can look at the code line by line to see where you've gone astray. It could be as simple as a typo or as complica... ABCDCBA,

There is no easy solution...

Wed, 20 Mar 2019 09:49:13 -07002 years ago1
🗨 1
🐏 0
👁 395
Profile Photo - Edgelady43069

Increasing max PHP input vars in WordPress?

Answers in Web Development | By Edgelady43069

Published

Profile Photo - Zhaybib

Last ReplyWhen you are in web development and you are interested in increasing max PHP input vars in Word Press, it is recommended that you check out this link... Zhaybib,

When you are in web devel...

Wed, 20 Mar 2019 02:33:15 -07002 years ago1
🗨 1
🐏 0
👁 311
Profile Photo - Some Guy

How to write "correct horse battery staple" passwords in PHP?

Answers in Server-Side | By Some Guy

Published

Profile Photo - August R. Garcia

Last Replyfunction correct_horse_battery_staple() { // The file that contains the words you want to use $f_contents = file(public_path() .... August R. Garcia,

Tue, 19 Mar 2019 19:23:10 -07002 years ago1
🗨 1
🐏 0
👁 495
Profile Photo - August R. Garcia

How to Automatically Merge and Minify CSS Files in Laravel 5.7

Articles in Frameworks | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

This also basically works for PHP in gen...

MoreChoose a CSS minifying function. This function from Datayze combined with this additional function to remove comments works fine. Ideally move th...
🗨 0
🐏 0
👁 754
Profile Photo - Some Guy

[Dreamhost] Increase PHP memory limit?

Answers in Server-Side | By Some Guy

Published

Profile Photo - 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...

Sat, 23 Feb 2019 01:54:09 -08002 years ago1
🗨 2
🐏 0
👁 699
Profile Photo - Some Guy

How to install Laravel properly?

Answers in Web Development | By Some Guy

Published

Profile Photo - roxblade

Last ReplyLaravel installation can be executed by following the simple instructions on Laravel docs here. roxblade,

Laravel installation can...

Mon, 18 Feb 2019 09:22:33 -08002 years ago1
🗨 1
🐏 0
👁 485
Profile Photo - August R. Garcia

[PHP] Embed and Autolink Everything with One Function Call: Vimeo, YouTube, DailyMotion, Imgur, and Gyazo

Articles in Server-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyFootnote - This post is part of a work-in-progress for 256Kilobyte's patch 1.6.0. May update this post later with minor bug fixes / QOL updates to the... August R. Garcia,

Footnote - This post is p...

Sun, 10 Feb 2019 22:23:57 -08002 years ago1
🗨 1
🐏 0
👁 776
Profile Photo - Some Guy
Profile Photo - August R. Garcia

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...

Wed, 06 Feb 2019 19:51:25 -08002 years ago1
🗨 1
🐏 0
👁 890
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Holy shit, use krsort(), not arsort().

MoreOkay, you fucking cocksuckers, I'm going to stab myself for the reason stated in the description.Anyway, here's some code to make a fucking "recently...
🗨 0
🐏 0
👁 2,124
Profile Photo - Some Guy

[PHP] Add ids to domdocument?

Answers in Server-Side | By Some Guy

Published

Profile Photo - August R. Garcia

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...

Sat, 02 Feb 2019 22:32:32 -08002 years ago1
🗨 2
🐏 0
👁 451
Profile Photo - Some Guy

[PHP] Sort associative array by value?

Answers in Server-Side | By Some Guy

Published

Profile Photo - August R. Garcia

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...

Sat, 02 Feb 2019 22:07:44 -08002 years ago1
🗨 2
🐏 0
👁 550
Profile Photo - Some Guy
Profile Photo - roxblade

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...

Sat, 02 Feb 2019 07:07:27 -08002 years ago1
🗨 1
🐏 0
👁 806
Profile Photo - Some Guy
Profile Photo - roxblade

Last ReplyIt is very tricky, to be honest. The first thing you should do is check if creating a larger image solves your problem. It's the simplest way, real... roxblade,

It is very tricky, to be...

Fri, 01 Feb 2019 03:13:48 -08002 years ago1
🗨 1
🐏 0
👁 560