<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.joeldare.com/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://www.joeldare.com/wiki/feed.php">
        <title>JoelDare.com php</title>
        <description></description>
        <link>https://www.joeldare.com/wiki/</link>
        <image rdf:resource="https://www.joeldare.com/wiki/lib/tpl/default/images/favicon.ico" />
       <dc:date>2026-05-03T01:13:00+0000</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:a_php_reference_tool_for_gedit?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:browser_authentication_with_php?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:converting_xml_to_csv_with_php?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:creating_an_excel_file_from_php?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:email_an_attachment_using_php?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:jdphplib?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:parsing_a_large_json_object_in_php_using_less_memory?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:php_public_private_key_cryptography?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:php_tips?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:plain_text_list_of_php_functions_and_their_arguments?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:post_with_file_get_contents_from_php?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:remove_blank_values_from_a_php_array?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:solr_tdate?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:speed_of_various_quoting_options?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:using_php_as_a_template_engine?rev=1591052021&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.joeldare.com/wiki/php:using_sqlite_in_php?rev=1591052021&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://www.joeldare.com/wiki/lib/tpl/default/images/favicon.ico">
        <title>JoelDare.com</title>
        <link>https://www.joeldare.com/wiki/</link>
        <url>https://www.joeldare.com/wiki/lib/tpl/default/images/favicon.ico</url>
    </image>
    <item rdf:about="https://www.joeldare.com/wiki/php:a_php_reference_tool_for_gedit?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>A PHP Reference Tool for gEdit</title>
        <link>https://www.joeldare.com/wiki/php:a_php_reference_tool_for_gedit?rev=1591052021&amp;do=diff</link>
        <description>A PHP Reference Tool for gEdit

If, like me, you write PHP code in gEdit, then you may find this reference tool helpful.  PHP has excellent documentation online, but it's a bit of a pain to switch back and forth between your editing tool and your browser just to find the order of arguments for a particular function.  I wrote a PHP script and created a list of PHP functions to handle these lookups for me.  These instructions describe how to install it in gEdit.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:browser_authentication_with_php?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Browser Authentication with PHP</title>
        <link>https://www.joeldare.com/wiki/php:browser_authentication_with_php?rev=1591052021&amp;do=diff</link>
        <description>Browser Authentication with PHP

Often, I need a quick and dirty way to check passwords on a website.  Sometimes, the passwords need to be secure, sometimes they don't.

One easy way to setup authentication is to let Apache do it for you.  That involves creating a .htaccess file and creating a password file.  But, did you know you can do the same thing directly from PHP?</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:converting_xml_to_csv_with_php?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Converting XML to CSV with PHP</title>
        <link>https://www.joeldare.com/wiki/php:converting_xml_to_csv_with_php?rev=1591052021&amp;do=diff</link>
        <description>Converting XML to CSV with PHP

Using PHP to convert XML to CSV is fairly easy, at least in the situations I've encountered so far.  In my case, it would save me significant work if I could simply convert structured XML data into CSV data.  Typically, I want to convert only the data in a particular xpath of the original XML document.  The PHP function below will load an XML file and convert the elements in the specified xpath to simple csv data.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:creating_an_excel_file_from_php?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Creating an Excel File from PHP</title>
        <link>https://www.joeldare.com/wiki/php:creating_an_excel_file_from_php?rev=1591052021&amp;do=diff</link>
        <description>Creating an Excel File from PHP

Okay, so this isn't really a Microsoft Excel file.  I cheat and create a tab delimited file that, given the XLS file extension, Excel will happily open as if it were.


&lt;?php

	// Trigger a download from the browser
	header(&quot;Content-Disposition: attachment; filename=\&quot;foo.xls\&quot;&quot;);
	header(&quot;Content-Type: application/vnd.ms-excel&quot;);
  
	// Echo the data, tab delimited
	echo &quot;Item 1\tItem 2\tItem3\n&quot;;
	echo &quot;9\t8\t7\n&quot;;

?&gt;</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:email_an_attachment_using_php?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Email an Attachment Using PHP</title>
        <link>https://www.joeldare.com/wiki/php:email_an_attachment_using_php?rev=1591052021&amp;do=diff</link>
        <description>Email an Attachment Using PHP

The following is an example of a PHP function that will MIME encode a file and send it via email as an attachment.

I'm pulling the filename from the command line ($argv[1]).  You could specify the address instead,  of course.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:jdphplib?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>jdPhpLib</title>
        <link>https://www.joeldare.com/wiki/php:jdphplib?rev=1591052021&amp;do=diff</link>
        <description>jdPhpLib

jdPhpLib is my library of various useful functions I've written in PHP.  Because these functions vary wildly, I do not store them in a single PHP file, but instead just copy and paste the functions I need for a particular job.

jdResize

This function returns the adjusted width and height of an image if it were resized to a maximum of $width by $height.  The function keeps the aspect ratio the same and returns an array that contains the new width, height, and a string that can be inser…</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:parsing_a_large_json_object_in_php_using_less_memory?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Parsing a Large JSON Object in PHP Using Less Memory</title>
        <link>https://www.joeldare.com/wiki/php:parsing_a_large_json_object_in_php_using_less_memory?rev=1591052021&amp;do=diff</link>
        <description>Parsing a Large JSON Object in PHP Using Less Memory

I've got a small project where I need to store between 500 and 1500 product records. I've thought about using MySQL, but I'd like to keep this particular application completely self contained (no real database). I'd also like to be able to edit the</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:php_public_private_key_cryptography?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP Public/Private Key Cryptography</title>
        <link>https://www.joeldare.com/wiki/php:php_public_private_key_cryptography?rev=1591052021&amp;do=diff</link>
        <description>PHP Public/Private Key Cryptography

PHP Public/Private key cryptography is fairly strait forward but at the time of this writing it's poorly documented.

Understanding how Public/Private Key Encryption Works

Before we get into how you do it, it's important to understand how it works.  The methods used to do public/private key encryption only work for a very small amount of data, less than 1024 bytes.  The exact number of bytes depends on the method used.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:php_tips?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>PHP Tips</title>
        <link>https://www.joeldare.com/wiki/php:php_tips?rev=1591052021&amp;do=diff</link>
        <description>PHP Tips

This is a collection of random PHP tips that I'm putting together for a Kindle book.

Apache Authentication

PHP Tips</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:plain_text_list_of_php_functions_and_their_arguments?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Plain Text List of PHP Functions and Their Arguments</title>
        <link>https://www.joeldare.com/wiki/php:plain_text_list_of_php_functions_and_their_arguments?rev=1591052021&amp;do=diff</link>
        <description>Plain Text List of PHP Functions and Their Arguments

I scoured the web looking for a simple list of all the PHP functions and their arguments.  After a lot of searching, I couldn't find the list I wanted.  So, I downloaded the PHP docs and wrote a little PHP program to create a list of function names.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:post_with_file_get_contents_from_php?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>POST with file_get_contents in PHP</title>
        <link>https://www.joeldare.com/wiki/php:post_with_file_get_contents_from_php?rev=1591052021&amp;do=diff</link>
        <description>POST with file_get_contents in PHP

Typically, when you use the file_get_contents() function in PHP you make a GET request.  It is possible, however, to make a POST request using the same tool.


	// Set the POST data
	$postdata = http_build_query(
		array(
			'email' =&gt; 'user@example.com',
			'name' =&gt; 'Some User'
		)
	);

	// Set the POST options
	$opts = array('http' =&gt; 
		array (
			'method' =&gt; 'POST',
			'header' =&gt; 'Content-type: application/xwww-form-urlencoded',
			'content' =&gt; $postdata…</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:remove_blank_values_from_a_php_array?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Remove Blank Values from a PHP Array</title>
        <link>https://www.joeldare.com/wiki/php:remove_blank_values_from_a_php_array?rev=1591052021&amp;do=diff</link>
        <description>Remove Blank Values from a PHP Array

I often have an array of values that I need to .  Take the following array as an example.
$photos = array (
  '',
  'http://www.joeldare.com/photo1.jpg',
  'http://www.joeldare.com/photo2.jpg',
  '',
  'http://www.joeldare.com/photo3.jpg',
  '',
);</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:solr_tdate?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Generate a Solr tDate String in PHP</title>
        <link>https://www.joeldare.com/wiki/php:solr_tdate?rev=1591052021&amp;do=diff</link>
        <description>Generate a Solr tDate String in PHP

You can generate a Solr formatted tDate string using the Date() function in PHP.  In order to do so, you'll need to escape the “T” and the “Z” in the date string.  Here's an example to get a Solr tDate of one year ago.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:speed_of_various_quoting_options?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Speed of Various PHP Quoting Options</title>
        <link>https://www.joeldare.com/wiki/php:speed_of_various_quoting_options?rev=1591052021&amp;do=diff</link>
        <description>Speed of Various PHP Quoting Options

I was discussing the speed of various quoting options in PHP with a co-worker.  He thought that variables inside of double quotes (“$a plus $b”) were faster than concatenated variables ($a . ' plus ' . $b), but I've heard the opposite.  I wanted to try those variations to see which was actually faster on my local machine and how much of a difference there was.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:using_php_as_a_template_engine?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Using PHP as a Template Engine</title>
        <link>https://www.joeldare.com/wiki/php:using_php_as_a_template_engine?rev=1591052021&amp;do=diff</link>
        <description>Using PHP as a Template Engine

There are lots of template engines scattered across the web.  Where I work we even wrote our own, which turned out to be a lot like Tiny But Strong.  But, if you're using PHP, you probably don't need a separate template engine; PHP is already a template language.</description>
    </item>
    <item rdf:about="https://www.joeldare.com/wiki/php:using_sqlite_in_php?rev=1591052021&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-06-01T22:53:41+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Using SQLite in PHP</title>
        <link>https://www.joeldare.com/wiki/php:using_sqlite_in_php?rev=1591052021&amp;do=diff</link>
        <description>Using SQLite in PHP

Here's an example of how to use SQLite in PHP.  In this example we use ':memory:' as the filename, which creates the database in memory instead of on the disk. We create a table, insert a couple records, and then select those records.</description>
    </item>
</rdf:RDF>
