0

I asked it here and found no response so far.

Here is a sample entry from the active_plugins line of WP_OPTIONS table:

a:5:{i:0;s:35:"add-from-server/add-from-server.php";i:1;s:25:"age-verify/age-verify.php";i:2;s:19:"jetpack/jetpack.php";i:4;s:69:"simple-full-screen-background-image/simple-full-screen-background.php";i:6;s:27:"wp-super-cache/wp-cache.php";}

My question is what are these s: entries? (s:35, s:19, s:27)

closed as off-topic by Pat J, TheDeadMedic, Howdy_McGee, Mayeenul Islam, Mark Kaplun Nov 13 '15 at 19:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    It's serialized data. The s: indicates the length of the string that follows. – Gabriel Nov 9 '15 at 14:48
  • I answered a similar question here, Gabriel is right it is serialized data. – Howdy_McGee Nov 11 '15 at 2:05
1

That entry is a PHP serialized array. The serialize method takes an array and stores it's value as a string so it can be stored elsewhere - like a database.

In the above example, the "s:" entries stand for "string:". With a serialized array, each element's data type is represented by a letter (a, s, o, etc) followed by a colon, then an optional length, and then a value. So...

a:5:{i:0;s:35:"add-from-server/add-from-server.php"

 a:5:{... - array, 5 elements 
 i:0 - integer, value of 0
 s:35:"add-from-server/add-from-server.php" - a string that is 35 characters long, and then the string itself

Edit: by the way, you should always interact with these by using the PHP methods to serialize and unserialize - if you removed the ".php" from that string above, you would break serialization unless you also changed the length in "s:35" to "s:31" (since four characters were removed). It's easy to break a WordPress installation by hand-editing serialized arrays.

  • Many many t h a n k s! @phatskat – Bengali Nov 9 '15 at 15:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.