<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>PHP on BradCypert.com</title>
    <link>https://www.bradcypert.com/tags/php/</link>
    <description>Recent content in PHP on BradCypert.com</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 06 May 2025 20:03:40 -0400</lastBuildDate>
    <atom:link href="https://www.bradcypert.com/tags/php/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Arrow Functions in PHP 7.4&#43;</title>
      <link>https://www.bradcypert.com/arrow-functions-in-php-7-4/</link>
      <pubDate>Tue, 31 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/arrow-functions-in-php-7-4/</guid>
      <description>&lt;p&gt;PHP is finally getting arrow functions (also known as Short Closures)! I know, I know. I’m just as excited as you are. Here’s everything you need to know about arrow functions in PHP.&lt;/p&gt;&#xA;&lt;p&gt;First, arrow functions are an approved RFC for PHP 7.4. If you’re using a version of PHP that’s lower than 7.4, you won’t be able to use arrow functions.&lt;/p&gt;&#xA;&lt;p&gt;Second, arrow functions can only contain one single expression. The goal with arrow functions (&lt;a href=&#34;https://wiki.php.net/rfc/arrow_functions_v2&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;as stated in the RFC&lt;/a&gt;&#xA;) is to help reduce verbosity and multi-line arrow functions are likely to cause more confusion than classic anonymous functions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a simple URL Shortener in PHP with Laravel</title>
      <link>https://www.bradcypert.com/building-a-simple-url-shortener-in-php-with-laravel/</link>
      <pubDate>Thu, 12 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/building-a-simple-url-shortener-in-php-with-laravel/</guid>
      <description>&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/YTD59Bv0rHE&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&lt;p&gt;I’ve recorded a quick Youtube video for you! In this video, we walk through building&#xA;a simple URL shortener (think bit.ly) in PHP with the &lt;a href=&#34;https://laravel.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Laravel &lt;/a&gt;&#xA;framework.&lt;/p&gt;&#xA;&lt;p&gt;This originally started as part of my Laravel foundations course (link coming soon) but I felt that we could quickly get through an example on Youtube, too. In the course, we dive into things and go a bit slower to really get a grasp on how everything works, but this less than 30 minute video should get you started down the right path.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to read from a file in PHP</title>
      <link>https://www.bradcypert.com/how-to-read-from-a-file-in-php/</link>
      <pubDate>Mon, 09 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/how-to-read-from-a-file-in-php/</guid>
      <description>&lt;p&gt;Reading from a file in PHP is an extremely common problem to solve. You may keep configuration variables in an environment file, or perhaps you pull in HTML from another file. Either way, you need your PHP code to read the contents of those files. Good news: It’s actually a fairly simple task to perform!&lt;/p&gt;&#xA;&lt;p&gt;What’s interesting is that there’s actually quite a few ways to read from a file in PHP. We’ll cover two common cases here and talk about why you’d use one over the other.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is Laravel&#39;s Homestead?</title>
      <link>https://www.bradcypert.com/what-is-laravels-homestead/</link>
      <pubDate>Sat, 29 Feb 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/what-is-laravels-homestead/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://laravel.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Laravel&lt;/a&gt;&#xA; is, as far as PHP frameworks go, extremely popular. In their guide, the Laravel community recommends you use Homestead as your local development environment. But what is Laravel’s homestead and why use it?&lt;/p&gt;&#xA;&lt;h2 id=&#34;laravels-homestead&#34;&gt;Laravel’s Homestead&lt;/h2&gt;&#xA;&lt;p&gt;Homestead is Laravel’s suggested development environment for building Laravel applications in PHP. Homestead is packaged as a vagrant box (a virtual machine) and is aimed to simply the initial setup of your Laravel project.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PHP: Add to an Array</title>
      <link>https://www.bradcypert.com/php-add-array/</link>
      <pubDate>Fri, 01 Feb 2019 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/php-add-array/</guid>
      <description>&lt;p&gt;It’s very common to find yourself working with Arrays in any language, and PHP is no exception. If you’re reading this, you probably want to find out how to add to an array in PHP but there’s one thing to cover first! Unlike most other languages, arrays in PHP are just an ordered map! Let’s declare an array to work with.&lt;/p&gt;&#xA;&lt;p&gt;Arrays can be declared similarly to map, but you can freely omit the keys.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Simple API in PHP using Lumen</title>
      <link>https://www.bradcypert.com/building-a-simple-api-in-php-using-lumen/</link>
      <pubDate>Sun, 22 Jan 2017 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/building-a-simple-api-in-php-using-lumen/</guid>
      <description>&lt;p&gt;Alright, at it again with another PHP post. Hopefully this doesn’t dislodge my blog from the &lt;a href=&#34;http://planet.clojure.in&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;planet.clojure.in&lt;/a&gt;&#xA; newsletter from writing too much non-clojure. The other day I wrote a post about using Slim with Eloquent to build a simple API. It was a fun project and I decided to share it with the PHP subreddit. Thankfully, the PHP community is far better than I remembered it — we created a lot of great feedback and had a few discussions about &lt;strong&gt;Lumen&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Simple API in PHP using Slim &amp; Eloquent</title>
      <link>https://www.bradcypert.com/building-a-restful-api-in-php-using-slim-eloquent/</link>
      <pubDate>Mon, 16 Jan 2017 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/building-a-restful-api-in-php-using-slim-eloquent/</guid>
      <description>&lt;p&gt;I’ve been exposed to a lot of PHP recently! I’ve been reviewing a course on functional PHP for a publishing company (link will be added once it’s released) and my friend has recruited me into working on an API that’s written in PHP using the Slim framework. I figured now would be a good time to write about my recent findings!&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.slimframework.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Slim is a microframework&lt;/a&gt;&#xA;, similar to &lt;a href=&#34;https://palletsprojects.com/p/flask/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Flask&lt;/a&gt;&#xA; or &lt;a href=&#34;http://sinatrarb.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sinatra&lt;/a&gt;&#xA; but for PHP. I’ve been pretty reserved about PHP in the past (It was the first language that I was paid to write) and I naturally associate PHP with poor code (because I wrote a ton of poor code in PHP). Perhaps you do that as well. Hopefully, by the end of this tutorial, I can help remedy that negative outlook on PHP as my own outlook on it has changed drastically over the past year.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
