I’m trying to simply read and thus reproduce the following code.
INSERT INTO `actions` (`aid`, `type`, `callback`, `parameters`, `description`) VALUES
('5', 'system', 'views_bulk_operations_script_action', 'a:1:{s:6:"script";s:452:"$string = $object->field_ruling_content[0][''value''];\r\n// do replacements\r\n$search = array(\r\n ''<h4>Membres</h4>'', \r\n ''<h4>Membre</h4>'',\r\n ''<h2><strong>Membres</strong></h2>'',\r\n ''<h2><strong>Membre</strong></h2>'',\r\n);\r\n$replace = array(\r\n ''<h2>Membres</h2>'',\r\n ''<h2>Membre</h2>'',\r\n ''<h2>Membres</h2>'',\r\n ''<h2>Membre</h2>'',\r\n );\r\n$string = str_replace($search, $replace, $string);\r\n$object->field_ruling_content[0][''value''] = $string;\r\nnode_save($object);";}', 'Cleanup');
The only bit that gets me confused is this a:1:{s:6:"script";s:452:". I tried looking up a:1:, s:6: and s:452: on google, but it didn’t quite get me the results I was looking for. What are they and what do they mean?
That is a serialized representation of PHP variables. You can decode it by running it through
unserialize().The syntax is fairly simple once you understand what it’s doing.
s:6:"script"means “string, six characters, contents ‘script'”.