Log In
Start
Free
Trial
Log In
Start
Free
Trial
Back To Course Home
Using Laravel for Advanced String Manipulation in PHP
0% completed
Introduction
Introduction
PHP and Laravel Version
What Are Strings?
A Brief History of Character Encodings
Unicode and UTF-8
Implementing Upper and Lowercase Functions
Iterating Multibyte Strings
Iterating UTF-8 Strings
Accessing Individual Characters in a UTF-8 String
Managing Character Encodings
Types of PHP Strings
Backticks and Laravel String Helpers
Quiz Yourself on Strings
Challenge: Iterating UTF-32 strings
Solution: Iterating UTF-32 Strings
Fluent Strings
Converting Fluent String Objects to Strings
Conditional String Logic
The Formatting Helper Methods
Formatting Strings with Camel Casing
Formatting Headlines
Formatting Strings with Kebab Casing
Lowercasing the First Character of a String
Creating Lowercase Variants of Strings
Reversing the Characters of a String
Creating a URL Friendly Slug From a Title
Formatting Strings with Snake Casing
Removing Extra Whitespace from a String
Formatting Strings with Studly Casing
Formatting Strings with Title Casing
Uppercasing the First Character of a String
Generating Uppercased Variants of Strings
Counting the Number of Words in a String
Quiz Yourself on Formatting Helper Methods
Challenge: The Formatting Helper Methods
Solution: The Formating Helper Methods
The Logical Helper Methods
Checking If a String Contains Another String
Checking If a String Contains Multiple Substrings
Checking If a String Ends with Another String
Checking If a String Starts with Another String
Checking If a String Contains Only ASCII Characters
Quiz Yourself on Logical Helper Methods
The Construction Helper Methods
Transliterating Characters to ASCII
Generating Excerpts of Text
Ensuring a String Always Ends with a Given String
Calculating String Length
Truncating Strings
Obscuring Parts of a String
Generating Pseudorandom Strings
Removing Substrings or Characters from Strings
Repeating Strings and Characters
Replacing Substrings
Sequentially Replacing Substrings in a String
Replacing the First Occurrence of a Substring or Character
Replacing the Last Occurrence of a Substring or Character
Ensuring Strings Always Begin with a Specific Prefix
Replacing a Key/Value Pair of Strings within a String
Splitting Strings on Uppercase Characters
Quiz Yourself on Construction Helper Methods
Challenge: Robust Text Processing Module
Solution: Robust Text Processing Module
The Extraction Helper Methods
Returning Part of a String after Another String or Character
Returning a Substring after the Last Occurrence of a String
Returning Part of a String before Another String or Character
Retrieving All Content before the Last Occurrence of a Substring
Retrieving Content between Two Search Strings
Retrieving the Smallest Amount of Content between Two Strings
Limiting the Number of Words in a String
Getting Portions of a String
Counting Occurrences of a Search String
Replacing Strings within a Portion of an Existing String
Quiz Yourself on Extraction Helper Methods
Challenge: Text Manipulation Application
Solution: Text Manipulation Application
Padding Strings
Padding the Beginning of Strings
Padding the End of Strings
Padding Both Sides of a String
Quiz Yourself on Padding Strings
String Translations and Extension
Working with Variable Replacements
Managing the Ranges of Items
Singular and Plural Word Forms
Extending Strings with Macros and Mixins
Quiz Yourself on String Translations
Lines and Words
Introduction to Lines and Words
Positions, Lines, and Columns
Splitting Strings into Words
Counting Word Occurrences
Finding Frequent and Repeated Words
Stop Words
Constructing Initialisms and Acronyms
Calculating Estimated Reading Time
Locating Words at Arbitrary Positions
Locating Neighbouring Words and Characters
Retrieving Adjacent Lines
Managing Text Indentation
Implementing an IndentationManager Class
Quiz Yourself on Lines and Words
Challenge: Determining the Number of Spaces per Indentation
Solution: Determining the Number of Spaces per Indentation
Challenge: Counting the Number of Unique Words
Solution: Counting the Number of Unique Words
Applied Techniques: Writing a Gherkin Parser
Modeling Gherkin
A Gherkin Lexer
Implementation of Gherkin Comments
Parsing Names
Parsing Step Text
Parsing Gherkin Descriptions
Parsing Scenario Tags
Parsing Step Parameters
Parsing Doc Strings
Parsing Gherkin Tables
Parsing Scenario Examples
Parsing Steps
Implementing Our Gherkin Parser: Parsing a Single Scenario
Parsing Scenario Outlines
Parsing Multiple Scenarios
Parsing Rules
Parsing Features
Adding Localization Support to the Gherkin Parser
Other Applications of Indentation-Based Parsers
Quiz Yourself on Applied Techniques of a Gherkin Parser
Challenge: Loading Locales from an External Source
Solution: Loading Locales from an External Source
Markov Chains and Text Generation
Writing a Markov Text Generator
Weighted Randomised Selection
Improving Our Text Generator
Quiz Yourself on Markov Chains and Text Generation
Fixed Width Data Parsing
Managing Data Conversions I
Managing Data Conversions II
Updating an Individual Record’s Values
Techniques for Managing Text Truncation
Quiz Yourself on Fixed Width Data Parsing
Challenge: Storing Arbitrarily Large Amounts of Data
Solution: Storing Arbitrarily Large Amounts of Data
Splitting Strings
Basic String Splitting
Splitting Strings Using Regular Expressions
Extracting YAML Frontmatter from Documents
Parsing Single-File Components
Splitting Input Containing Substrings with the Delimiter
Splitting Strings Using Cursors
Implementing the Strings Cursor
Creating a String Cursor Using Additional Utility Methods
A Simple PHP Tokenizer
Working with SQL-Style Strings
Splitting Strings Containing Paired Brackets
Quiz Yourself on Splitting Strings
Applied Techniques: A Blade Directive Validator
Scaffolding the Parser Implementation
Parsing Blade Directives
Parsing Directive Parameters
Validating Blade Directives
Validating Blade Directives
Quiz Yourself on the Blade Directive Validator
Challenge: Parsing Blade Echos
Solution: Parsing Blade Echos
Working with HTML
Reversing Double Encoded HTML Entities
Working with Embedded Languages
Parsing Fragmented HTML Documents
Parsing HTML Attributes and Parameters
Analyzing Fragmented HTML Documents
Quiz Yourself on Working with HTML
Challenge: Add a Class List to a Specific Paragraph
Solution: Add a Class List to a Specific Paragraph
Regular Expressions
Regular Expression Syntax Primer
Analyzing Different Types of Regular Expressions
Quiz Yourself on Regular Expressions
Challenge: Adjust the Pattern to Return the Required Matches
Solution: Adjust the Pattern To Return the Required Matches
Conclusion
Wrap Up
Appendix
Appendix A
Quiz Yourself on Strings
Test your knowledge regarding strings.
Get hands-on with 1200+ tech skills courses.
Start Free Trial