🚗🏍️ Welcome to Motoshare!

Turning Idle Vehicles into Shared Rides & New Earnings.
Why let your bike or car sit idle when it can earn for you and move someone else forward?

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Partners earn. Renters ride. Everyone wins.

Start Your Journey with Motoshare

Replace \n with br in Laravel

Laravel

Step 1:- Html code

<!DOCTYPE html>
<html>
<head>
    <title>Replace Newlines Example</title>
</head>
<body>
    <h1>Text with Newlines:</h1>
    <pre>{{ $textWithNewlines }}</pre>

    <h1>Text with Line Breaks:</h1>
    <p>{!! $textWithLineBreaks !!}</p>
</body>
</html>

Step 2:- web.php

Route::get('/',[UserController::class,'View'])->name('view');

Step 3:- Controller

 public function View()
    {
        $textWithNewlines = "This is line 1.\nThis is line 2.\nThis is line 3.";
        $textWithLineBreaks = nl2br($textWithNewlines);
    
        return view('importFile', compact('textWithLineBreaks','textWithNewlines'));
    }

Output:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x