Today, the front-end of the waterfall message board is finished. let's take a look. the serialize () serialized unserialize () deserialized functions: config_set () and config_get. [php]/*** used to write out array configuration */f... "/> <scripttype =" text/ja
Today, we have finished the front-end of the waterfall message board. let's take a look.
What I learned today
Serialize () serialization
Unserialize () deserialization
The two functions compile the config_set () and config_get () functions.
[Php]
/**
* Used to write out array configurations
*/
Function config_set ($ fileName, $ arr_var ){
File_put_contents ($ fileName, serialize ($ arr_var ));
}
/**
* Used to read the configuration. the returned value is the set array.
*/
Function config_get ($ fileName ){
If (file_exists ($ fileName )){
Return unserialize (file_get_contents ($ fileName ));
}
}
/**
* Used to write out array configurations
*/
Function config_set ($ fileName, $ arr_var ){
File_put_contents ($ fileName, serialize ($ arr_var ));
}
/**
* Used to read the configuration. the returned value is the set array.
*/
Function config_get ($ fileName ){
If (file_exists ($ fileName )){
Return unserialize (file_get_contents ($ fileName ));
}
} Call method
[Php]
$ Config = array (
'Title' => 'Waterfall message board ',
"B" => 'AAA'
);
Config_set ("data. php", $ config );
$ Config = config_get ('data. php ');
Var_dump ($ config );
$ Config = array (
'Title' => 'Waterfall message board ',
"B" => 'AAA'
);
Config_set ("data. php", $ config );
$ Config = config_get ('data. php ');
Var_dump ($ config );
2. how to use the '[]' in the jquery selector, remove the style from the removedClass, and add the style to the addClass to easily highlight the style.
Var focus_li = $ ("# menu li [class! = Nav-header] ");
Focus_li.click (function (){
Focus_li.removeClass ("active"); // remove all highlighted styles
$ (This). addClass ("active"); // add a highlighted style to the clicked
3. for session, unset ($ _ sesstion) cannot be cleared. session_unset () is used ()
4. rewrite the chrome browser in the message form at the front end. the effect of IE is less special and not very nice.
[Html]
5. the drop-down button in the background is very beautiful.
[Html]
Welcome Back <{$ userName}>
Welcome Back <{$ userName}>