<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>conversion | MaxVergelli.com</title>
	<atom:link href="https://www.maxvergelli.com/tag/conversion/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.maxvergelli.com</link>
	<description>sourcecode repository</description>
	<lastBuildDate>Fri, 17 Apr 2020 18:11:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i2.wp.com/www.maxvergelli.com/wp-content/uploads/2020/04/wp-1586823685141.png?fit=32%2C32&#038;ssl=1</url>
	<title>conversion | MaxVergelli.com</title>
	<link>https://www.maxvergelli.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">34603511</site>	<item>
		<title>How to convert HDR10+ videos to SDR (for non-HDR devices)</title>
		<link>https://www.maxvergelli.com/how-to-convert-hdr10-videos-to-sdr-for-non-hdr-devices/</link>
					<comments>https://www.maxvergelli.com/how-to-convert-hdr10-videos-to-sdr-for-non-hdr-devices/#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Fri, 17 Apr 2020 13:02:00 +0000</pubDate>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Video Editing]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[format-conversion]]></category>
		<category><![CDATA[galaxy-s10]]></category>
		<category><![CDATA[hdr]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[mp4]]></category>
		<category><![CDATA[sdr]]></category>
		<category><![CDATA[smartphone]]></category>
		<category><![CDATA[standard-dynamic-range]]></category>
		<category><![CDATA[tv]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[video-conversion]]></category>
		<category><![CDATA[video-editing]]></category>
		<guid isPermaLink="false">https://www.maxvergelli.com/?p=251</guid>

					<description><![CDATA[<p>How to convert HDR10+ videos to SDR, so can be viewed on non-HDR devices with brightful and not washed-out colors</p>
<p>The post <a href="https://www.maxvergelli.com/how-to-convert-hdr10-videos-to-sdr-for-non-hdr-devices/">How to convert HDR10+ videos to SDR (for non-HDR devices)</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>New smartphones like <em>Samsung Galaxy S10</em> and <em>S10+</em> can record videos in HDR10+, a new standard in HDR, which redefine the concept of Higher Dynamic Range (<em><strong>HDR</strong></em>). <a href="https://www.youtube.com/watch?v=aws42wl7cck" target="_blank" aria-label="Watch this video (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Watch this video</a> to learn how to record videos in HDR10+, otherwise, continue reading the post&#8230;</p>



<h4><strong>Differences with HDR and how HDR10+ works</strong>&#8230;</h4>



<p>The standard HDR technology adds up the static metadata to the content (*.MP4 video). This will mean that the parameters are applied at the beginning itself and continue throughout. This causes the bright scenes in a movie look too bright and lose detail, while the dark scenes would continue to look dim. In HDR10+ the brightness boundaries of the video clip is configured and changed in a frame by frame manner, the full-color range is added to every scene dynamically no matter whether it contains only dark or only light scenes. </p>



<p>In other words, HDR10+ ensures that you will end up getting the best details in your videos and images.</p>



<h3><strong>How an HDR10+ video is viewed on supported and non-HDR devices</strong></h3>



<p>There is a problem, when viewing an HDR10+ video on a device that does not support the HDR10+ standard, the video will be displayed as in the following image on the left (with washed-out colors), while on a Galaxy S10 smartphone or TV that supports HDR10+ you will see it as in the image on the right</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="800" height="226" src="https://i0.wp.com/www.maxvergelli.com/wp-content/uploads/2020/04/hdr-to-sdr.jpg?resize=800%2C226&#038;ssl=1" alt="" class="wp-image-252" srcset="https://i0.wp.com/www.maxvergelli.com/wp-content/uploads/2020/04/hdr-to-sdr.jpg?w=800&amp;ssl=1 800w, https://i0.wp.com/www.maxvergelli.com/wp-content/uploads/2020/04/hdr-to-sdr.jpg?resize=300%2C85&amp;ssl=1 300w, https://i0.wp.com/www.maxvergelli.com/wp-content/uploads/2020/04/hdr-to-sdr.jpg?resize=768%2C217&amp;ssl=1 768w" sizes="(max-width: 800px) 100vw, 800px" data-recalc-dims="1" /></figure>



<p>So, to view an HDR10+ video on an unsupported device, <strong>we must first convert it to a video in SDR (standard dynamic range)</strong> which however must retains the same depth and intensity of colors, without washed-out colors, as the original HDR10+ video.</p>



<h2><strong>How to convert HDR10+ video to SDR on PC</strong></h2>



<p>To make the video conversion from HDR10+ to SDR is very simple on a Samsung Galaxy S10 smartphone, but <strong>in this article I will explain how to convert it on PC</strong> (otherwise, if you want to know how to convert it on Galaxy S10, <a aria-label="read this from Samsung (opens in a new tab)" href="https://www.samsung.com/us/support/answer/ANS00086003/" target="_blank" rel="noreferrer noopener" class="aioseop-link">read this from Samsung</a>).</p>



<p>First of all, you need the <strong>ffmpeg</strong> software, a free command-line tool that converts audio or video formats; from this link <a href="http://ffmpeg.org/download.html" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">http://ffmpeg.org/download.html</a> look for &#8220;Get packages &amp; executable files&#8221;, and download the compiled version for your OS (Linux, Windows or Mac).</p>



<h4><strong>Step 1</strong> : <strong>Extract FFMPEG to a folder</strong></h4>



<p>Extract the contents of the zip file to a new folder in &#8220;C:\ffmpeg\&#8221; (this is a windows path, but you can change it at your convenience).</p>



<h4><strong>Step 2</strong> : <strong>Create a Batch file and copy your HDR10+ video to convert</strong></h4>



<p>Create a new file named &#8220;convert.bat&#8221; in &#8220;C:\ffmpeg\bin&#8221; with the following code</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;Shell&quot;,&quot;modeName&quot;:&quot;shell&quot;}">C:\ffmpeg\bin\ffmpeg.exe -i video-input.mp4 -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -c:v libx265 -crf 22 -preset medium -tune fastdecode video-output.mp4</pre></div>



<p>Then, copy your HDR10+ video in &#8220;C:\ffmpeg\bin&#8221; and rename it in &#8220;video-input.mp4&#8221;</p>



<h4><strong>Step 3</strong> : <strong>Open a command prompt and execute the batch</strong></h4>



<p>Now, press <strong>Windows</strong> button+<strong>R</strong> to <strong>open</strong> the “Run” box. Type “<strong>cmd</strong>” and click “OK” to open a regular Command Prompt. Finally, type &#8220;C:\ffmpeg\bin\convert.bat&#8221; to start the conversion from HDR10+ video to a new SDR video named &#8220;video-output.mp4&#8221;.</p>



<h4><strong>Conversion completed!</strong></h4>



<p>At the end of the conversion, you will find the new converted file in the &#8220;C:\ffmpeg\bin\&#8221; folder. </p>



<p>The new SDR file &#8220;video-output.mp4&#8221; <strong>can be viewed on all non-HDR devices, but with the same brightful colors</strong> as the original HDR10+ video.</p>



<p>Have fun converting your movies! 😀</p><p>The post <a href="https://www.maxvergelli.com/how-to-convert-hdr10-videos-to-sdr-for-non-hdr-devices/">How to convert HDR10+ videos to SDR (for non-HDR devices)</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/how-to-convert-hdr10-videos-to-sdr-for-non-hdr-devices/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">251</post-id>	</item>
		<item>
		<title>Display the total number of days between two dates in PHP</title>
		<link>https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/</link>
					<comments>https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Fri, 10 Apr 2020 14:30:00 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[String Manipulation Algorithms]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[count-days]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date-conversion]]></category>
		<category><![CDATA[date-interval]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[time-difference]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=147</guid>

					<description><![CDATA[<p>PHP: How to display the total number of days between two dates in PHP, using the DateTime class and compare them via diff() method</p>
<p>The post <a href="https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/">Display the total number of days between two dates in PHP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To count the total number of days between two dates, use the <code>DateTime</code> class and compare them via <code>diff()</code> method with the following few lines of code</p>


<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}">$date1 = new DateTime('2020-01-01'); 
$date2 = new DateTime('2020-02-15'); 
print_r($date1-&gt;diff($date2));</pre></div>



<p>And the output will be:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application/json&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;languageLabel&quot;:&quot;no&quot;,&quot;language&quot;:&quot;JSON&quot;,&quot;modeName&quot;:&quot;json&quot;}">DateInterval Object ( 
  [y] =&gt; 0 
  [m] =&gt; 1 
  [d] =&gt; 14 
  [h] =&gt; 0 
  [i] =&gt; 0 
  [s] =&gt; 0 
  [f] =&gt; 0 
  [weekday] =&gt; 0 
  [weekday_behavior] =&gt; 0 
  [first_last_day_of] =&gt; 0 
  [invert] =&gt; 0 
  [days] =&gt; 45 
  [special_type] =&gt; 0 
  [special_amount] =&gt; 0 
  [have_weekday_relative] =&gt; 0 
  [have_special_relative] =&gt; 0 
)</pre></div><p>The post <a href="https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/">Display the total number of days between two dates in PHP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">147</post-id>	</item>
		<item>
		<title>Convert a DateTime string to a Unix timestamp in VbScript / Classic ASP</title>
		<link>https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/</link>
					<comments>https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Wed, 18 Mar 2020 14:10:43 +0000</pubDate>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MS Access]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[String Manipulation Algorithms]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[classic-asp]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date-conversion]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[datetime-conversion]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[mysql-datetime]]></category>
		<category><![CDATA[mysql-datetime-conversion]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[unix-timestamp]]></category>
		<category><![CDATA[vbscript]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=124</guid>

					<description><![CDATA[<p>To convert a datetime string value like &#8220;YYYY-MM-DD HH:MM:SS&#8221; to a Unix timestamp (the seconds from 01/01/1970 to the input datetime) You can use a conversion function as the following: Then, to get back the datetime from the Unix timestamp &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/" aria-label="Convert a DateTime string to a Unix timestamp in VbScript / Classic ASP">Read More</a></p>
<p>The post <a href="https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/">Convert a DateTime string to a Unix timestamp in VbScript / Classic ASP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To convert a datetime string value like &#8220;YYYY-MM-DD HH:MM:SS&#8221; to a Unix timestamp (the seconds from 01/01/1970 to the input datetime) You can use a conversion function as the following:</p>


<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;vbscript&quot;,&quot;mime&quot;:&quot;text/vbscript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;VBScript&quot;,&quot;modeName&quot;:&quot;vb&quot;}">Function ConvertToUnixTimeStamp(input_datetime) 'As String 
  Dim d
  d = CDate(input_datetime) 
  ConvertToUnixTimeStamp = CStr(DateDiff(&quot;s&quot;, &quot;01/01/1970 00:00:00&quot;, d)) 
End Function</pre></div>



<p>Then, to get back the datetime from the Unix timestamp use the following code:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;vbscript&quot;,&quot;mime&quot;:&quot;text/vbscript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;VBScript&quot;,&quot;modeName&quot;:&quot;vb&quot;}">Function ConvertUnixTimeStampToDateTime(input_unix_timestamp) 'As String [regular datetime] 
  ConvertUnixTimeStampToDateTime = CStr(DateAdd(&quot;s&quot;, input_unix_timestamp, &quot;01/01/1970 00:00:00&quot;)) 
End Function</pre></div>



<p></p><p>The post <a href="https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/">Convert a DateTime string to a Unix timestamp in VbScript / Classic ASP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">124</post-id>	</item>
		<item>
		<title>Base64 encoding / decoding functions in VbScript / Classic ASP</title>
		<link>https://www.maxvergelli.com/base64-encoding-decoding-functions-in-vbscript-classic-asp/</link>
					<comments>https://www.maxvergelli.com/base64-encoding-decoding-functions-in-vbscript-classic-asp/#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Fri, 06 Mar 2020 13:43:10 +0000</pubDate>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[classic-asp]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[decoding]]></category>
		<category><![CDATA[decryption]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[vbscript]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=122</guid>

					<description><![CDATA[<p>With the following functions Base64Encode(sText) and Base64Decode(ByVal vCode), You can easly encode/decode a text in/from base64 in VBScript/Classic ASP:</p>
<p>The post <a href="https://www.maxvergelli.com/base64-encoding-decoding-functions-in-vbscript-classic-asp/">Base64 encoding / decoding functions in VbScript / Classic ASP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span id="result_box" class="" lang="en">With the following functions <em>Base64Encode(sText)</em> and <em>Base64Decode(ByVal vCode)</em>, You can easly encode/decode a text in/from base64 in VBScript/Classic ASP:</span></p>


<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;vbscript&quot;,&quot;mime&quot;:&quot;text/vbscript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;VBScript&quot;,&quot;modeName&quot;:&quot;vb&quot;}">Function Base64Encode(sText)
  Dim oXML, oNode
  Set oXML = CreateObject(&quot;Msxml2.DOMDocument.3.0&quot;)
  Set oNode = oXML.CreateElement(&quot;base64&quot;)
  oNode.dataType = &quot;bin.base64&quot;
  oNode.nodeTypedValue = Stream_StringToBinary(sText)
  Base64Encode = oNode.text
  Set oNode = Nothing
  Set oXML = Nothing
End Function

Function Base64Decode(ByVal vCode)
  Dim oXML, oNode
  Set oXML = CreateObject(&quot;Msxml2.DOMDocument.3.0&quot;)
  Set oNode = oXML.CreateElement(&quot;base64&quot;)
  oNode.dataType = &quot;bin.base64&quot;
  oNode.text = vCode
  Base64Decode = Stream_BinaryToString(oNode.nodeTypedValue)
  Set oNode = Nothing
  Set oXML = Nothing
End Function

Private Function Stream_StringToBinary(Text)
  Const adTypeText = 2
  Const adTypeBinary = 1
  Dim BinaryStream 'As New Stream
  Set BinaryStream = CreateObject(&quot;ADODB.Stream&quot;)
  BinaryStream.Type = adTypeText
  BinaryStream.CharSet = &quot;us-ascii&quot;
  BinaryStream.Open
  BinaryStream.WriteText Text
  BinaryStream.Position = 0
  BinaryStream.Type = adTypeBinary
  BinaryStream.Position = 0
  Stream_StringToBinary = BinaryStream.Read
  Set BinaryStream = Nothing
End Function

Private Function Stream_BinaryToString(Binary)
  Const adTypeText = 2
  Const adTypeBinary = 1
  Dim BinaryStream 'As New Stream
  Set BinaryStream = CreateObject(&quot;ADODB.Stream&quot;)
  BinaryStream.Type = adTypeBinary
  BinaryStream.Open
  BinaryStream.Write Binary
  BinaryStream.Position = 0
  BinaryStream.Type = adTypeText
  BinaryStream.CharSet = &quot;us-ascii&quot;
  Stream_BinaryToString = BinaryStream.ReadText
  Set BinaryStream = Nothing
End Function</pre></div>



<p></p><p>The post <a href="https://www.maxvergelli.com/base64-encoding-decoding-functions-in-vbscript-classic-asp/">Base64 encoding / decoding functions in VbScript / Classic ASP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/base64-encoding-decoding-functions-in-vbscript-classic-asp/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">122</post-id>	</item>
		<item>
		<title>How to export an ASP Associative Array to XML</title>
		<link>https://www.maxvergelli.com/how-to-export-an-asp-associative-array-to-xml/</link>
					<comments>https://www.maxvergelli.com/how-to-export-an-asp-associative-array-to-xml/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Sat, 15 Feb 2020 16:27:57 +0000</pubDate>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MS Access]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array-function]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[asp-associative-array]]></category>
		<category><![CDATA[associative-array]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[data-layer]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[datetime-conversion]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[enumerating]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[helper-class]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[wrapper-class]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=82</guid>

					<description><![CDATA[<p>&#8220;Asp Associative Array Class&#8221; provides a method to easly export all items to a well formatted XML string. For example, You can create a new *.ASP file : [sourcecode language=&#8221;vb&#8221;] &#60;!&#8211;#include file=&#34;AssociativeArrayClass.asp&#34; &#8211;&#62; &#60;% Dim Person, God Set Person = &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/how-to-export-an-asp-associative-array-to-xml/" aria-label="How to export an ASP Associative Array to XML">Read More</a></p>
<p>The post <a href="https://www.maxvergelli.com/how-to-export-an-asp-associative-array-to-xml/">How to export an ASP Associative Array to XML</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="https://sourceforge.net/projects/asp-assoc-array/files/ASP_Associative_Array.rar/download" target="_blank" rel="noopener noreferrer">&#8220;Asp Associative Array Class&#8221;</a> provides a method to easly export all items to a well formatted XML string. For example, You can create a new *.ASP file :</p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
&lt;!&#8211;#include file=&quot;AssociativeArrayClass.asp&quot; &#8211;&gt;<br />
&lt;%<br />
Dim Person, God<br />
Set Person = New AssociativeArray<br />
Set God = New AssociativeArray<br />
Person(&quot;name&quot;) = &quot;Max&quot;<br />
Person(&quot;surname&quot;) = &quot;Vergelli&quot;<br />
God(&quot;name&quot;) = &quot;Jesus&quot;<br />
God(&quot;surname&quot;) = &quot;Christ&quot;<br />
Dim World<br />
Set World = New AssociativeArray<br />
World(1) = Person<br />
World(2) = God<br />
response.Write World.ToXML()<br />
%&gt;<br />
[/sourcecode]</p>
<p>And You will get out the following XML:</p>
<p>[sourcecode language=&#8221;xml&#8221;]<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />
&lt;array&gt;<br />
      &lt;key&gt;<br />
            &lt;name&gt;&lt;![CDATA[1]]&gt;&lt;/name&gt;<br />
            &lt;value&gt;<br />
                    &lt;key&gt;<br />
                           &lt;name&gt;&lt;![CDATA[name]]&gt;&lt;/name&gt;<br />
                           &lt;value&gt;&lt;![CDATA[Max]]&gt;&lt;/value&gt;<br />
                    &lt;/key&gt;<br />
                    &lt;key&gt;<br />
                           &lt;name&gt;&lt;![CDATA[surname]]&gt;&lt;/name&gt;<br />
                           &lt;value&gt;&lt;![CDATA[Vergelli]]&gt;&lt;/value&gt;<br />
                   &lt;/key&gt;<br />
           &lt;/value&gt;<br />
      &lt;/key&gt;<br />
      &lt;key&gt;<br />
             &lt;name&gt;&lt;![CDATA[2]]&gt;&lt;/name&gt;<br />
             &lt;value&gt;<br />
                    &lt;key&gt;<br />
                           &lt;name&gt;&lt;![CDATA[name]]&gt;&lt;/name&gt;<br />
                           &lt;value&gt;&lt;![CDATA[Jesus]]&gt;&lt;/value&gt;<br />
                    &lt;/key&gt;<br />
                    &lt;key&gt;<br />
                          &lt;name&gt;&lt;![CDATA[surname]]&gt;&lt;/name&gt;<br />
                          &lt;value&gt;&lt;![CDATA[Christ]]&gt;&lt;/value&gt;<br />
                    &lt;/key&gt;<br />
             &lt;/value&gt;<br />
       &lt;/key&gt;<br />
&lt;/array&gt;<br />
[/sourcecode]</p><p>The post <a href="https://www.maxvergelli.com/how-to-export-an-asp-associative-array-to-xml/">How to export an ASP Associative Array to XML</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/how-to-export-an-asp-associative-array-to-xml/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">82</post-id>	</item>
		<item>
		<title>How to use Associative Arrays in ASP</title>
		<link>https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/</link>
					<comments>https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Sat, 01 Feb 2020 16:03:13 +0000</pubDate>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MS Access]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array-function]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[asp-associative-array]]></category>
		<category><![CDATA[associative-array]]></category>
		<category><![CDATA[classic-asp]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[data-layer]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[datetime-conversion]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[enumerating]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[helper-class]]></category>
		<category><![CDATA[isarray-function]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[wrapper-class]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=78</guid>

					<description><![CDATA[<p>First of all, You need to download the &#8220;Asp Associative Array class&#8221; then include the file &#8220;AssociativeArrayClass.asp&#8221; in your asp page. Right now, You can start declaring associative arrays in ASP with the following syntax: [sourcecode language=&#8221;vb&#8221;] Dim Person Set &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/" aria-label="How to use Associative Arrays in ASP">Read More</a></p>
<p>The post <a href="https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/">How to use Associative Arrays in ASP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>First of all, You need to download the <a href="http://sourceforge.net/projects/asp-assoc-array/">&#8220;Asp Associative Array class&#8221;</a> then include the file &#8220;AssociativeArrayClass.asp&#8221; in your asp page.</p>
<p>Right now, You can start declaring associative arrays in ASP with the following syntax:</p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
Dim Person<br />
Set Person = New AssociativeArray<br />
Person(&quot;name&quot;)    =   &quot;Max&quot;<br />
Person(&quot;surname&quot;) =   &quot;Vergelli&quot;<br />
Response.Write Person(&quot;name&quot;) &amp; &quot; &quot; &amp; Person(&quot;surname&quot;)<br />
[/sourcecode]</p>
<p>In the above example, the key &#8220;name&#8221; in &#8220;Person&#8221; object, stores &#8220;Max&#8221; value. You can set strings or integers for the key and <strong>any object/variant type for the relative value</strong>. However, You can not set key with Null or &#8220;&#8221; strings like the following:</p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
&#8216;invalid keys&#8230;<br />
Person(Null) = &quot;Null Key&quot;<br />
Person(&quot;&quot;) = &quot;Empty String&quot;<br />
Dim undefined<br />
Person(undefined) = &quot;Variable Not Initialized&quot;<br />
Response.Write Person(&quot;&quot;) &amp; Person(Null) &amp; Person(undefined)<br />
[/sourcecode]</p>
<p><strong>How to get every item of the associative array:</strong><br />
You can make a &#8220;For Each&#8221; loop on the array like in the following code</p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
For Each element In Person.Items<br />
   Response.Write element.Key &amp; &quot; : &quot; &amp; element.Value &amp; vbCrLf<br />
Next<br />
[/sourcecode]</p>
<p>&#8220;Person.Items&#8221; gets all the items inside the associative array and for each item You can get &#8220;Key&#8221; and &#8220;Value&#8221; properties.</p>
<p><strong>How to copy an associative array:</strong></p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
Dim Person_Clone             &#8216;it&#8217;s a Variant type<br />
Set Person_Clone = Person    &#8216;NOTE: Use &quot;Set&quot; statement!<br />
&#8216;print values<br />
Response.Write Person_Clone(&quot;name&quot;) &amp; &quot; &quot; &amp; Person_Clone(&quot;surname&quot;) &amp; vbCrLf<br />
&#8216;get each key/value<br />
For Each element In Person_Clone.Items<br />
   Response.Write element.Key &amp; &quot; : &quot; &amp; element.Value &amp; vbCrLf<br />
Next<br />
[/sourcecode]</p>
<p><strong>How to create nested associative arrays&#8230;</strong><br />
You can create infinite nested associative arrays and accessing them like the following:</p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
Dim Person<br />
Set Person = New AssociativeArray<br />
Person(&quot;name&quot;) = &quot;Max&quot;<br />
Person(&quot;surname&quot;) = &quot;Vergelli&quot;<br />
Dim People<br />
Set People = New AssociativeArray<br />
People(1) = Person<br />
People(2) = Person<br />
People(3) = Person<br />
Response.Write People(1)(&quot;name&quot;) &amp; &quot; &quot; &amp; People(1)(&quot;surname&quot;)<br />
[/sourcecode]</p>
<p>Besides, You can enumerate all the keys/values inside the &#8220;People&#8221; associative array object</p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
For Each element In People.Items<br />
   Dim el_person<br />
   Set el_person = element.Value<br />
   Response.Write el_person(&quot;name&quot;) &amp; &quot; : &quot; &amp; el_person(&quot;surname&quot;) &amp; vbCrLf<br />
Next<br />
[/sourcecode]</p><p>The post <a href="https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/">How to use Associative Arrays in ASP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/how-to-use-associative-arrays-in-asp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">78</post-id>	</item>
		<item>
		<title>VBScript Class to create easly Associative Arrays in ASP like in PHP</title>
		<link>https://www.maxvergelli.com/vbscript-class-to-create-easly-associative-arrays-in-asp-like-in-php/</link>
					<comments>https://www.maxvergelli.com/vbscript-class-to-create-easly-associative-arrays-in-asp-like-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Wed, 22 Jan 2020 15:53:47 +0000</pubDate>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MS Access]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[asp-associative-array]]></category>
		<category><![CDATA[associative-array]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[classic-asp]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[data-layer]]></category>
		<category><![CDATA[datatype]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[helper-class]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[ms-access]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[wrapper-class]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=76</guid>

					<description><![CDATA[<p>I&#8217;ve posted a project at Source Forge with an ASP/VBScript class to create easly associative arrays like in PHP; visit http://sourceforge.net/projects/asp-assoc-array/ It is possible also load in an associative-array the data coming from MySQL or MS Access databases, then You &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/vbscript-class-to-create-easly-associative-arrays-in-asp-like-in-php/" aria-label="VBScript Class to create easly Associative Arrays in ASP like in PHP">Read More</a></p>
<p>The post <a href="https://www.maxvergelli.com/vbscript-class-to-create-easly-associative-arrays-in-asp-like-in-php/">VBScript Class to create easly Associative Arrays in ASP like in PHP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve posted a project at Source Forge with an ASP/VBScript class to create easly associative arrays like in PHP; visit <a href="http://sourceforge.net/projects/asp-assoc-array/">http://sourceforge.net/projects/asp-assoc-array/</a></p>
<p>It is possible also load in an associative-array the data coming from MySQL or MS Access databases, then You can programmatically manage the structured data; You can also export associative arrays to XML.</p>
<p>Associative arrays are usefull when it is necessary manage many variables at once (for example when we pass multiple values at once to a method/function) or just to store data in a well structured array and reusing  its values anytime.</p><p>The post <a href="https://www.maxvergelli.com/vbscript-class-to-create-easly-associative-arrays-in-asp-like-in-php/">VBScript Class to create easly Associative Arrays in ASP like in PHP</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/vbscript-class-to-create-easly-associative-arrays-in-asp-like-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">76</post-id>	</item>
		<item>
		<title>Online JSON Validator</title>
		<link>https://www.maxvergelli.com/online-json-validator/</link>
					<comments>https://www.maxvergelli.com/online-json-validator/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Mon, 06 Jan 2020 15:16:20 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[data-layer]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[enumerating]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[validator]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=61</guid>

					<description><![CDATA[<p>If You are bored of having to test many JSON structures in JavaScript, You can validate your JSON data with this useful online tool: http://jsonlint.com/</p>
<p>The post <a href="https://www.maxvergelli.com/online-json-validator/">Online JSON Validator</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>If You are bored of having to test many JSON structures in JavaScript, You can validate your JSON data with this useful online tool: <a href="http://jsonlint.com/">http://jsonlint.com/</a> </p><p>The post <a href="https://www.maxvergelli.com/online-json-validator/">Online JSON Validator</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/online-json-validator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">61</post-id>	</item>
		<item>
		<title>PHP Date or Datetime to MySQL Datetime and viceversa</title>
		<link>https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/</link>
					<comments>https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Sat, 21 Dec 2019 15:10:11 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[String Manipulation Algorithms]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[conversione]]></category>
		<category><![CDATA[data-layer]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[datetime-conversion]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[helper-class]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-datetime]]></category>
		<category><![CDATA[mysql-datetime-conversion]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=59</guid>

					<description><![CDATA[<p>Two useful PHP functions to convert normal date/datetime (&#8220;25.12.2010 12:10:00&#8221; or &#8220;25.12.2010&#8221;) to MySQL datetime (like &#8220;2010-12-25 12:10:00&#8221; or &#8220;2010-12-25 00:00:00&#8243;); You can get back a date/datetime from MySQL datetime too: [sourcecode language=&#8221;php&#8221;] function datetime2mysqldatetime($datetime){ // &#8216;25.12.2010 12:10:00&#8217; -&#62; &#8216;2010-12-25 &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/" aria-label="PHP Date or Datetime to MySQL Datetime and viceversa">Read More</a></p>
<p>The post <a href="https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/">PHP Date or Datetime to MySQL Datetime and viceversa</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Two useful PHP functions to convert normal date/datetime (&#8220;25.12.2010 12:10:00&#8221; or &#8220;25.12.2010&#8221;) to MySQL datetime (like &#8220;2010-12-25 12:10:00&#8221; or &#8220;2010-12-25 00:00:00&#8243;); You can get back a date/datetime from MySQL datetime too:</p>
<p>[sourcecode language=&#8221;php&#8221;]<br />
	function datetime2mysqldatetime($datetime){				// &#8216;25.12.2010 12:10:00&#8217; -&gt; &#8216;2010-12-25 12:10:00&#8217;<br />
		return date(&#8216;Y-m-d H:i:s&#8217;, strtotime($datetime)); 	// &#8216;25.12.2010&#8217; 		 -&gt; &#8216;2010-12-25 00:00:00&#8217;<br />
	}</p>
<p>	function mysqldatetime2datetime($mysql_datetime){	// &#8216;2010-12-25 12:10:00&#8217; -&gt; &#8216;25.12.2010 12:10:00&#8217;<br />
		$d = split(&#8216; &#8216;, $mysql_datetime);				// &#8216;2010-12-25&#8217; 		 -&gt; &#8216;25.12.2010&#8217;<br />
		if($d &amp;&amp; count($d)&gt;1){<br />
			list($year, $month, $day) = split(&#8216;-&#8216;, $d[0]);<br />
			list($hour, $minute, $second) = split(&#8216;:&#8217;, $d[1]);<br />
			$d = date(&#8216;d.m.Y H:i:s&#8217;, mktime($hour, $minute, $second, $month, $day, $year));}<br />
		else if($d &amp;&amp; count($d)==1){<br />
			list($year, $month, $day) = split(&#8216;-&#8216;, $d[0]);<br />
			$d = date(&#8216;d.m.Y&#8217;, mktime(0, 0, 0, $month, $day, $year));<br />
		} else {<br />
			$d = NULL;<br />
		}<br />
		return $d;<br />
	}<br />
[/sourcecode]</p>
<p>Max 🙂</p><p>The post <a href="https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/">PHP Date or Datetime to MySQL Datetime and viceversa</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">59</post-id>	</item>
		<item>
		<title>Easy-to-use and strong Encrypt/Decrypt PHP functions</title>
		<link>https://www.maxvergelli.com/easy-to-use-strong-encrypt-decrypt-php-functions/</link>
					<comments>https://www.maxvergelli.com/easy-to-use-strong-encrypt-decrypt-php-functions/#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Tue, 10 Dec 2019 15:04:26 +0000</pubDate>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[decryption]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[hashing]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rijndael]]></category>
		<category><![CDATA[SHA1]]></category>
		<category><![CDATA[SHA256]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[String-class]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=57</guid>

					<description><![CDATA[<p>I wrote those two following PHP functions to encrypt and decrypt strings easly and with a stronger encryption module than the other examples on the net (please, note that &#8220;strong&#8221; does not equals &#8220;secure&#8221;!); Happy encryption/decryption! 🙂 Max [sourcecode language=&#8221;php&#8221;] &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/easy-to-use-strong-encrypt-decrypt-php-functions/" aria-label="Easy-to-use and strong Encrypt/Decrypt PHP functions">Read More</a></p>
<p>The post <a href="https://www.maxvergelli.com/easy-to-use-strong-encrypt-decrypt-php-functions/">Easy-to-use and strong Encrypt/Decrypt PHP functions</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I wrote those two following PHP functions to encrypt and decrypt strings easly and with a stronger encryption module than the other examples on the net (please, note that &#8220;strong&#8221; does not equals &#8220;secure&#8221;!);</p>
<p>Happy encryption/decryption! 🙂</p>
<p>Max</p>
<p>[sourcecode language=&#8221;php&#8221;]<br />
	function encrypt($input_string, $key){<br />
		$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);<br />
		$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);<br />
		$h_key = hash(&#8216;sha256&#8217;, $key, TRUE);<br />
		return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $h_key, $input_string, MCRYPT_MODE_ECB, $iv));<br />
	}</p>
<p>	function decrypt($encrypted_input_string, $key){<br />
		$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);<br />
		$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);<br />
		$h_key = hash(&#8216;sha256&#8217;, $key, TRUE);<br />
		return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $h_key, base64_decode($encrypted_input_string), MCRYPT_MODE_ECB, $iv));<br />
	}<br />
[/sourcecode]</p><p>The post <a href="https://www.maxvergelli.com/easy-to-use-strong-encrypt-decrypt-php-functions/">Easy-to-use and strong Encrypt/Decrypt PHP functions</a> first appeared on <a href="https://www.maxvergelli.com">MaxVergelli.com</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/easy-to-use-strong-encrypt-decrypt-php-functions/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">57</post-id>	</item>
	</channel>
</rss>
