<?php
$text = '{ifvar[?]}<tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there\'s a casting call in your area that perfectly matches your profile, you\'ll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;"> </span>
</td>
</tr>
{/ifvar}';
/*
echo '<pre style="color:green">';
echo htmlentities($text);
echo '</pre>';
*/
echo '<pre style="color:red">';
echo htmlentities(_replaceIfVarTags($text));
echo '</pre>';
function _replaceIfVarTags($text) {
// $text = iconv("UTF-8", "UTF-8//IGNORE", $text);
$regexp = '/\\{!?ifvar\\[(.*?)(?=\\]})\\]\\}(([\\s\\S](?!\\{!?ifvar))*?)\\{\\/ifvar\\}/i';
preg_match_all($regexp, $text, $matches);
echo '<hr><pre style="color:black">';
echo htmlentities(print_r($matches,1));
echo '</pre><hr>';
if (!$matches || !$matches[0]) return $text;
foreach ($matches[0] as $k => $v) {
$value = trim($matches[1][$k]);
if (strpos($v, '{!ifvar') === false) {
if (in_array($value, ['', '0', 0, false, 'false', null], true)) {
$text = str_replace($v, '', $text);
}
else {
$text = str_replace($v, $matches[2][$k], $text);
}
}
else {
if ($value === '') {
$text = str_replace($v, $matches[2][$k], $text);
}
else {
$text = str_replace($v, '', $text);
}
}
}
//return _replaceIfVarTags($text);
}
- Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.4, 8.3.6 - 8.3.7
- <pre style="color:red"><hr><pre style="color:black">Array
(
[0] => Array
(
[0] => {ifvar[?]}<tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there's a casting call in your area that perfectly matches your profile, you'll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span>
</td>
</tr>
{/ifvar}
)
[1] => Array
(
[0] => ?
)
[2] => Array
(
[0] => <tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there's a casting call in your area that perfectly matches your profile, you'll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span>
</td>
</tr>
)
[3] => Array
(
[0] =>
)
)
</pre><hr>
Deprecated: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated in /in/h3S5N on line 45
</pre>
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
<pre style="color:red"><hr><pre style="color:black">Array
(
[0] => Array
(
[0] => {ifvar[?]}<tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there's a casting call in your area that perfectly matches your profile, you'll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span>
</td>
</tr>
{/ifvar}
)
[1] => Array
(
[0] => ?
)
[2] => Array
(
[0] => <tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there's a casting call in your area that perfectly matches your profile, you'll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span>
</td>
</tr>
)
[3] => Array
(
[0] =>
)
)
</pre><hr>
Deprecated: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated in /in/h3S5N on line 45
</pre>
- Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.30, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
- <pre style="color:red"><hr><pre style="color:black">Array
(
[0] => Array
(
[0] => {ifvar[?]}<tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there's a casting call in your area that perfectly matches your profile, you'll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span>
</td>
</tr>
{/ifvar}
)
[1] => Array
(
[0] => ?
)
[2] => Array
(
[0] => <tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there's a casting call in your area that perfectly matches your profile, you'll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span>
</td>
</tr>
)
[3] => Array
(
[0] =>
)
)
</pre><hr></pre>
- Output for 7.0.0 - 7.0.29, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
- <pre style="color:red"><hr><pre style="color:black">Array
(
[0] => Array
(
)
[1] => Array
(
)
[2] => Array
(
)
[3] => Array
(
)
)
</pre><hr>{ifvar[?]}<tr> <td class="padding-left20 padding-right20"
style="padding: 5px 40px 0 40px; background-color: #f8f8f8;">
<span class="size24"
style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;">
Enjoy our internal messaging system
</span>
<span class="size14" style="display: block;">
What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there's a casting call in your area that perfectly matches your profile, you'll get notified as well!
</span>
<span class="size14" style="display: block; padding: 10px 0 0 0;">
You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors!
</span>
<span style="display: block; max-width: 210px; padding: 30px 0 0 0;"
class="btnFullWidth size14">
<span class="desktop-btn"
style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;">
<a href="{GES_SINGLE_LOGIN_URL}&goto=/messages"
style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;">
<span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span>
</a>
</span>
</span>
</td>
</tr>
<tr>
<td style="padding:0;">
<span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span>
</td>
</tr>
{/ifvar}</pre>
- Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
- Parse error: syntax error, unexpected '[' in /in/h3S5N on line 64
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected '[' in /in/h3S5N on line 64
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error in /in/h3S5N on line 64
Process exited with code 255.
preferences:
217.37 ms | 401 KiB | 389 Q