Skip to content

Instantly share code, notes, and snippets.

@javimata
Created February 10, 2018 01:34
Show Gist options
  • Save javimata/3eb84d29c83801169601ae28cc6a3f02 to your computer and use it in GitHub Desktop.
Save javimata/3eb84d29c83801169601ae28cc6a3f02 to your computer and use it in GitHub Desktop.
obtener params
<?php
$contenido = 'Aqui iria el contenido {jForm type="text" value="nombre"} de prueba {jForm test="probandox"} test.';
$regex = '/{jForm\s(.*?)}/i';
preg_match_all($regex, $contenido, $matches, PREG_SET_ORDER);
if ($matches)
{
foreach ($matches as $match)
{
$matcheslist = explode(',', $match[1]);
// $pattern = '/\{jForm\}(.*?)\{\/jForm\}/s';
$position = trim($matcheslist[0]);
echo $position;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment