Support the ongoing development of Laravel.io →
Input Packages
Last updated 2 years ago.
0

I don't exactly see how this is a Laravel specific issue, and not sure if I understand the problem correctly. Are you trying to modify an actual php source file, or just any plain text file? Are you trying to insert into the fifth line?

If that is the case then reading the file into arrays and inserting into the fourth index, and dumping the content back may work (though with large files it'll soon be a bad idea). Is that what you meant?

Last updated 2 years ago.
0

I don't exactly see how this is a Laravel specific issue, and not sure if I understand the problem correctly. Are you trying to modify an actual php source file, or just any plain text file? Are you trying to insert into the fifth line?

If that is the case then reading the file into arrays and inserting into the fourth index, and dumping the content back may work (though with large files it'll soon be a bad idea). Is that what you meant?

Last updated 2 years ago.
0

take a look at File::put() function.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

yuomtheara yuomtheara Joined 12 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.