Skip to content

Instantly share code, notes, and snippets.

@PCianes
Created July 8, 2017 21:23
Show Gist options
  • Save PCianes/55a9de1586e3da9f5f6545537a69a908 to your computer and use it in GitHub Desktop.
Save PCianes/55a9de1586e3da9f5f6545537a69a908 to your computer and use it in GitHub Desktop.
Shortcode into php with ob_start()
<?php ob_start(); ?>
<CENTER>
<FORM>
<input type="button" value="Submit">
</FORM>
</CENTER>
<?php $to_lock = ob_get_contents(); ob_end_clean(); ?>
<?php echo do_shortcode('[sociallocker]'.$to_lock.'[/sociallocker]');?>
<?php
include('carga-previa.php');
ob_start();
echo '<h1>Hola mundo</h1>';
if (!is_readable('chao.txt')) $msgStack->add('No se encontró el archivo!');
else $msgStack->add('Se encontró el archivo!');
$titulo = 'Hola mundo';
$contenido = ob_get_contents();
ob_end_clean();
include('cabecera.php');
echo $contenido;
include('pie-pagina.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment