LaraDumps
  • What is LaraDumps?
  • Get Started
    • Installation
    • Configuration
  • Commands
    • Simple
    • Color
    • Log Application
    • Show queries
    • Clear History
    • Custom Label
    • JSON Validate
    • Contains
    • Table
    • Screens
    • Diff
    • Model
  • Reference
    • Livewire
  • App
    • Host
    • IDE
Powered by GitBook
On this page
  1. Commands

Contains

PreviousJSON ValidateNextTable

Last updated 2 years ago

Inspecting and debugging long strings for specific words can be tiresome and time consuming. Use the method contains() to check if the payload contains a specific string.

$html   = '<select name="select-choice" id="select-choice"><option value="Choice 1">Choice 1</option><option value="Choice 2">Choice 2</option><option value="Choice 3">Choice 3</option></select>';

ds($html)->contains('Choice 3');

$string   = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam, quidem?';
$expected = 'muspi';

ds($string)->contains($expected);
Contains