Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
¿Cómo podría establecer el título de las páginas como contenido de un archivo de texto?

Tengo una página que necesita un título actualizado dinámicamente. Tengo un archivo .txt que otro script actualiza dinámicamente en mi sitio web y me gustaría establecer el contenido de ese archivo como el título de la página (la etiqueta <title> ). ¿Puede alguien ayudarme?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

siga el siguiente ejemplo, no lo he probado, pero inténtelo una vez

 <?php $data = fopen("c:\\folder\\testing.txt", "r"); $ln_array = []; $fp = fopen("testfile.txt", "r"); while (!feof($fp)) { // do stuff to the current line here array_push($ln_array, $fp); } fclose($fp); ?>
about 4 years ago · Juan Pablo Isaza Report

0

En PHP, puede leer el archivo txt y hacer eco más tarde

 <!DOCTYPE html> <html lang="en"> <head> <?php $myfile = fopen("file.txt", "r") or die("Unable to open file!"); $content = fgets($myfile); fclose($myfile); ?> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo htmlspecialchars($content, ENT_QUOTES, 'UTF-8'); ?></title> </head> <body> </body> </html>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!