Posteriormente a investigar con expertos en el tema, programadores de varias áreas y maestros hemos dado con la respuesta al problema y la compartimos en esta publicación.
Ejemplo 1: php en html
Basic PHP Syntax
A PHP script can be placed anywhere in the document.
A PHP script starts with and ends with ?>:
// PHP code goes here?>
The default file extension for PHP files is ".php".
A PHP file normally contains HTML tags, and some PHP scripting code.
Example
DOCTYPEhtml><html><body><h1>Php in htmlh1>echo"Hello World!";?>body>html>
Ejemplo 2: cómo vincular html con php
/* PHP code can be easily injected into a standard HTML page. As a rule,
* files with mixed content of that kind have .phtml extention. The workflow
* is the same as for pure .php scripts: one should setup web-server to
* handle .phtml files the same way it handles .php - .phtml should be passed
* to PHP engine, and the outcome gotta be sent to a visitor. PHP will parse
* the .phtml and process everything inside tags [..]?>, ignoring the
* rest. I.e. the php code pieces in .phtml will be replaced in outcome with
* results of their processing, and HTML / CSS / JavaScript code in .phtml,
* as well as text content, will be displayed in browser as is. The one and
* only strict rule - your .phtml mixes must always start with PHP tag
* sequence ?>, otherwise they won't be preprocessed by PHP engine.
*/
/**
* @category Template
* @packageHello_World
*/$tpl='Hello %s!';?>doctypehtml><htmllang="en"><head><title>printf($tpl,'World');?>title><style>bodytext-align: center;style>head><body><h1>printf($tpl,'world of '.date('Y').', the wonderful future world');?>h1>body>html>
Si guardas algún recelo y disposición de limar nuestro crónica te mencionamos dejar una glosa y con gusto lo leeremos.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)