How to integrate Python with PHP? |
@christaliise: You can't do it like you want. You will need to read the entire file into memory and append the new data at the beginning and saving it again.
$a = file_get_contents('filename.txt'); $b = 'New information' . $a; file_put_contents('filename.txt', $b); Regarding the reverse part, it depends on what you are storing. Can it be parsed and stored in an array? https://www.php.net/manual/en/function.a...everse.php And as you can't do this in PHP. Don't do it. It will give you problems down the road. So live with the limitation and redesign your application. |
Messages In This Thread |
How to integrate Python with PHP? - by christaliise - 01-18-2020, 06:13 AM
RE: How to integrate Python with PHP? - by jreklund - 01-18-2020, 03:43 PM
RE: How to integrate Python with PHP? - by christaliise - 01-18-2020, 06:22 PM
RE: How to integrate Python with PHP? - by jreklund - 01-19-2020, 05:08 AM
RE: How to integrate Python with PHP? - by christaliise - 01-19-2020, 08:05 AM
RE: How to integrate Python with PHP? - by eggbert - 01-19-2020, 08:31 AM
RE: How to integrate Python with PHP? - by christaliise - 01-19-2020, 10:03 AM
RE: How to integrate Python with PHP? - by eggbert - 01-19-2020, 01:12 PM
RE: How to integrate Python with PHP? - by includebeer - 01-20-2020, 04:23 AM
RE: How to integrate Python with PHP? - by jreklund - 01-19-2020, 11:49 AM
|