snipt

Ctrl+h for KB shortcuts

Markdown

PHP CAPTCHA library for CodeIgniter

The Securimage library - an open-source free PHP CAPTCHA

link https://github.com/abstractcodify/securimage_for_ci

DOC https://www.phpcaptcha.org/

https://snipt.net/embed/011af216de3b4f1ab440dbf953a91f7b/
/raw/011af216de3b4f1ab440dbf953a91f7b/
011af216de3b4f1ab440dbf953a91f7b
markdown
Markdown
6
2017-01-01T08:29:46
True
False
True
Sep 30, 2014 at 04:45 AM
/api/public/snipt/136624/
php-captcha-library-for-codeigniter-a40f52d2
<p>The Securimage library - an open-source free PHP CAPTCHA </p> <p>link <a href="https://github.com/abstractcodify/securimage_for_ci">https://github.com/abstractcodify/securimage_for_ci</a></p> <p>DOC <a href="https://www.phpcaptcha.org/">https://www.phpcaptcha.org/</a></p>
captcha, codeigniter, php

JavaScript

Convert php array to Javascript array

1
2
3
4
5
6
<?php
$php_array = array('abc','def','ghi');
$js_array = json_encode($php_array);
echo "var javascript_array = ". $js_array . ";\n";
?>
console.log( javascript_array );
https://snipt.net/embed/e51096dfe7d0911468f6ef93246883b4/
/raw/e51096dfe7d0911468f6ef93246883b4/
e51096dfe7d0911468f6ef93246883b4
js
JavaScript
6
2016-12-26T15:10:33
True
False
True
Aug 26, 2014 at 11:32 PM
/api/public/snipt/136258/
convert-php-array-to-javascript-array-b05e6202
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="o">&lt;?</span><span class="nx">php</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">$php_array</span> <span class="o">=</span> <span class="nx">array</span><span class="p">(</span><span class="s1">&#39;abc&#39;</span><span class="p">,</span><span class="s1">&#39;def&#39;</span><span class="p">,</span><span class="s1">&#39;ghi&#39;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nx">$js_array</span> <span class="o">=</span> <span class="nx">json_encode</span><span class="p">(</span><span class="nx">$php_array</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="nx">echo</span> <span class="s2">&quot;var javascript_array = &quot;</span><span class="p">.</span> <span class="nx">$js_array</span> <span class="p">.</span> <span class="s2">&quot;;\n&quot;</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a><span class="o">?&gt;</span> </span><span id="L-6"><a name="L-6"></a><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">javascript_array</span> <span class="p">);</span> </span></pre></div> </td></tr></table>
array, convert, javascript, php

Text only

Advanced Custom Fields: Hide If No Content In Admin

1
2
3
4
5
<?php if(!get_field('alert', 'option')){ }else{?>
	<div id="alert">
		<?php the_field('alert', 'option'); ?>
	</div>	
<?php } ?>
https://snipt.net/embed/b7aeb3065255cd52bc4ecc9c8f88987f/
/raw/b7aeb3065255cd52bc4ecc9c8f88987f/
b7aeb3065255cd52bc4ecc9c8f88987f
text
Text only
5
2019-06-23T19:12:13
True
False
False
/api/public/snipt/135578/
advanced-custom-fields-hide-if-no-content-in-admin-953007a5
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;?php if(!get_field(&#39;alert&#39;, &#39;option&#39;)){ }else{?&gt; </span><span id="L-2"><a name="L-2"></a> &lt;div id=&quot;alert&quot;&gt; </span><span id="L-3"><a name="L-3"></a> &lt;?php the_field(&#39;alert&#39;, &#39;option&#39;); ?&gt; </span><span id="L-4"><a name="L-4"></a> &lt;/div&gt; </span><span id="L-5"><a name="L-5"></a>&lt;?php } ?&gt; </span></pre></div> </td></tr></table>
acf, php