-
-
Notifications
You must be signed in to change notification settings - Fork 156
add the content of the file in a variable #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! Can you provide more details? |
Hi, I have a file une Files of Mikrotik and i wanted to copy the content in a variable with this code: $query = (new Query('/file/print'))
->where('.id', $file['.id']);
$fileContent = $client->query($query)->read();
$content = $fileContent[0]['contents']; But only the first line of the file is on the variable; When I debugging, I see the only first line is show on the content: $filesQuery = (new Query('/file/print'));
files = $client->query($filesQuery)->read();
echo "<pre>Files List: "; print_r($files); echo "</pre>";
|
fix this |
Forma 1 - If you want to concatenate everything into a string: $filesQuery = (new Query('/file/print')); $content =' '; foreach ($fileContent as $file) { Forma 2 - If you want to put everything together in an array: $filesQuery = (new Query('/file/print')); $content = []; foreach ($fileContent as $file) { |
but only the first line of the file is on the variable
How can I have the entire content on the variable?
It s for create the config client ovpn with certificate.
The text was updated successfully, but these errors were encountered: