-
Notifications
You must be signed in to change notification settings - Fork 1
/
1
53 lines (42 loc) · 1.58 KB
/
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
#ibwbwb
#brwobnwrbonwrbow
#ibwrbwrbwrbwrbjwnrtesting new error June 3
#Changing this comment to reflect test commiting old plugin locally and updating plugin on Dashoard.`
#Trying new push since break the other day June 1, 2015
#newcommitcomment
#bwrnetneFOREEALMANNYSUCK
#nrrreeeuuh
#test new deny
#testing new push April 1st
##Tresting post commit
#One mo gain
/* Data serialization test
*
* Tesing this after reading about data serialization
* Specifically with themes and plugins saving values
* in the WordPress Database.
* This saves on having to set tables for each value in a setting when
* using arrays.
*
* The output of the serialized array looks like this
* a:3:{i:0;s:5:"apple";i:1;s:6:"banana";i:2;s:6:"orange";}
*/
#This is the opening Echo
echo "\n<br>###Welcome to serialized arrays!###<br><br> \nBelow is an example of a PHP Array that has been serialized<br><br>"."\n\n";
#This sets the origina array to serialize
$data = array ('apple','banana','orange');
#this sets a variable to the ouput of the serialized array and echo's it
$serialized_data = serialize ( $data );
echo ( $serialized_data )."\n\n"."<br><br>";
#this one will actuall set the variable to the output of the unserialzed array
#and then do a for loop to print the values of the array once they
#have been deserialized
echo "\n###Below is an example of the same PHP Array now deserialized###<br><br>"."\n\n";
$unserialized_data = unserialize ( $serialized_data );
$length = count ( $unserialized_data);
for ( $i = 0; $i < $length ; $i++ ) {
print $unserialized_data[$i]."\n";
echo "<br>";
}
?>