Welcome Guest, Not a member yet? Register   Sign In
Problem with parser
#7

(This post was last modified: 08-31-2018, 08:47 PM by John_Betong.)

Try this:
PHP Code:
// ADDED quotes because variables not available
$data = [
 
 'site_name'      => '$ConfigurationSite->name',
 
 'seo_title'      => '$ConfigurationSite->title',
 
 'seo_book_title' => '$SeoBooks->title'
]; 

// http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

// BEWARE OF TRAILING SPACES
$tmp = <<< ____TMP
<meta property="og:description" content="{$data['seo_book_title']}" />

____TMP;
// BEWARE OF TRAILING SPACES

echo htmlspecialchars($tmp); 

Result: 

<meta property="og:description" content="$SeoBooks->title" />
Reply


Messages In This Thread
Problem with parser - by Decibel150 - 08-31-2018, 08:11 AM
RE: Problem with parser - by Pertti - 08-31-2018, 08:57 AM
RE: Problem with parser - by Decibel150 - 08-31-2018, 09:50 AM
RE: Problem with parser - by ciadmin - 08-31-2018, 10:51 AM
RE: Problem with parser - by Decibel150 - 08-31-2018, 12:53 PM
RE: Problem with parser - by ciadmin - 08-31-2018, 03:03 PM
RE: Problem with parser - by John_Betong - 08-31-2018, 08:42 PM
RE: Problem with parser - by Decibel150 - 09-01-2018, 07:09 AM
RE: Problem with parser - by ciadmin - 09-01-2018, 07:44 AM
RE: Problem with parser - by Decibel150 - 09-01-2018, 08:41 AM
RE: Problem with parser - by John_Betong - 09-01-2018, 11:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB