- Accidental Creative
- Adapting to Web Standards: CSS and Ajax for Big Sites
- Art of Non-Conformity
- Art of Readable Code
- Back to the User: Creating User-Focused Web Sites
- Beginning PHP6, Apache, MySQL Web Development
- Books to Read
- Bored and Brilliant
- Born For This
- Complete E-Commerce Book
- Content Inc
- Core PHP Programming
- CSS3: Pushing the Limits
- Dealing with Difficult People
- Defensive Design for the Web
- Deliver First Class Web sites
- Design for Hackers: Reverse-Engineering Beauty
- Designing Web Interfaces
- Designing Web sites that Work: Usability for the Web
- Designing with Progressive Enhancement
- Developing Large Web Applications
- Eat That Frog
- Economics of Software Quality
- Elements of User Experience
- Epic Content Marketing
- Extending Bootstrap
- Flexible Web Design
- Flexible Web Layouts
- Happiness At Work
- Inmates Are Running the Asylum
- jQuery Pocket Reference
- Letting Go of the Words
- Making Every Meeting Matter
- Manage Your Day to Day
- Marketing to Millenials
- Monster Loyalty
- More Eric Meye on CSS
- Official Ubuntu Book
- Organized Home
- Perennial Seller
- PHP In a NutShell
- PHP Refactoring
- PHP5 CMS Framework Development
- PHP6 and MySQL Bible
- Privacy Policy
- Responsive Web Design
- Responsive Web Design with HTML and CSS3
- Rules of Thumb
- Saleable Software
- Securing PHP Web Applications
- Simple and Usable Web, Mobile and Interaction Design
- Smart Organizing
- Submit Now: Designing Persuasive Web sites
- The Life-changing Magic of Tidying up
- This Is Marketing
- UI and UX and Design
- Web site Usability
- Web Site Usability: A Designer's Guide
- Web Word Wizardy
- Well Designed
- Work for Money, Design for Love
- Blogs
- Checklists I Have Collected or Created
- Crafts To Do
- Database and Data Relations Checklist
- Ecommerce Website Checklist
- My Front End UI Checklist
- New Client Needs Analysis
- Newsletters I Read
- Puzzles
- Style Guides
- User Review Questions
- Web Designer's SEO Checklist
- Web site Review
- Website Code Checklist
- Website Final Approval Form
- Writing Content For Your Website
- Writing Styleguide
- Writing Tips
- Complete Book of Potatoes
- Creating Custom Soil Mixes for Healthy, Happy Plants
- Edible Forest Garden
- Garden Design
- Gardening Tips and Tricks
- Gardens and History
- Herbs
- Houseplants
- Light Candle Levels
- My Garden
- My Garden To Plant
- Organic Fertilizers
- Organic Gardening in Alberta
- Plant Nurseries
- Plant Suggestions
- Planting Tips and Ideas
- Root Cellaring
- Things I Planted in My Yard
- Way We Garden Now
- 101 Organic Gardening Hacks
- Beautiful No-Mow Lawns
- Beginner's Guide to Heirloom Vegetables
- Best of Lois Hole
- Eradicate Invasive Plants
- Gardening Books to Read
- Gardens West
- Grow Organic
- Grow Your own Herbs
- Guerilla Gardening
- Heirloom Life Gardener
- Indoor Gardening: The Organic Way
- Real Gardens Grow Natives
- Seed Underground
- Small plot, high yield gardening
- Thrifty Gardening from the Ground Up
- Vegetables
- Veggie Garden Remix
- Weeds
- What Grows Here
- Activities for Kids
- Baking & Cooking Tips
- Bertrand Russell
- Can I Get that on Sale?
- Cleaning Tips and Tricks
- Colour Palettes I Like
- Compound Time
- Cooking Tips
- Crafts
- Crafts for Kids
- Household Tips
- Inspiration
- Interesting
- Interior Design
- Latin Phrases
- Laundry Tips
- Learn Something New
- Links, Information, and Cool Videos - Stuff for My Kids
- My Miscellany
- Organizing
- Quotes
- Reading List
- Renovations
- Silly Sites
- Things that Make Me Laugh
- Videos to Watch
- YouTube Hacks
- Accessibility
- CSS Frameworks
- CSS Reading List
- CSS Sticky Footer
- htaccess files
- HTML Tips and Tricks
- Javascript (and jQuery)
- Landing Page Tips
- Making Better Websites
- More Information on CSS
- MySQL and Databases
- Navigation
- Responsive Design
- Robots.txt File
- Security and Secure Websites
- SVG Images
- Web Design and Development
- Web Design Tools
- Web Error Codes
- Website Testing Checklist
- Writing for the Web
- Writing Ideas for your website
- Animations and Interactions
- Being a Better Designer
- Bootstrap Resources
- Color in Web Design
- Colour
- CSS Preprocessors: Sass and Less
- CSS Tips Tricks
- Design Systems
- Designing User Interfaces
- Font & Typographical Inspiration
- Fonts, Typography, Letters & Symbols
- Icons
- Logo Designs
- Photoshop Tips and Tricks
- Sketch
- UX and UI and Design Reading List
- Web Forms
Core PHP Programming, Third Edition
- By: Leon Atkinson
- Publisher: Prentice Hall
- Pub. Date: August 05, 2003
- Print ISBN-13: 978-0-13-046346-3
usleep(integer microseconds)
The usleep function (Listing 14.12) causes execution to pause for the given number of microseconds. There are a million microseconds in a second.
integer ip2long(string address)
The ip2long function takes an IP address and returns an integer. This allows you to compress a 16-byte string into a 4-byte integer. Use long2ip to reverse the process.
string long2ip(integer address)
Use long2ip to get the textual representation of an IP address. Use ip2long to reverse the process.
array parse_url(string query)
The parse_url function breaks a URL into an associative array with the following elements: fragment, host, pass, path, port, query, scheme, user. The query is not evaluated as with the parse_str function.
array fgetcsv(resource file, integer length, string separator)
array get_meta_tags(string filename, boolean use_include_path)
The get_meta_tags function opens a file and scans for HTML meta tags. The function assumes it is a well-formed HTML file that uses native linebreaks. An array indexed by the name attribute of the meta tag is returned. If the name contains any characters illegal in identifiers, they will be replaced with underscores.
boolean is_file(string filename)
The is_file function returns TRUE if the given filename is neither a directory nor a symbolic link; otherwise it returns FALSE. Similar functions are is_dir and is_link.
boolean is_uploaded_file(string filename)
The is_uploaded_file function returns TRUE if a file was uploaded in an HTML form during the current request. Its purpose is to ensure that the file you expect to treat as an upload was indeed uploaded.
boolean is_writeable(string filename)
boolean error_log(string message, integer type, string destination, string extra_headers)
The error_log function sends an error message to one of four places depending on the type argument. An alternative to error_log is the syslog function.
string highlight_string(string code, boolean return_instead)
The highlight_string function prints a string of PHP code to the browser using syntax highlighting. If the optional return_instead argument is TRUE, PHP returns the HTML instead of printing it.
string gethostbyaddr(string ip_address)
The gethostbyaddr function returns the name of the host specified by the numerical IP address. If the host cannot be resolved, the address is returned.
Sessions in Database
In fact, PHP can handle all these details for you. What's missing from the standard functionality is database integration. You can use session_set_save_handler to keep the session data in a database. The big advantage is that PHP takes care of generating session identifiers and sending them to the browser. The big disadvantage is that PHP keeps the session data as a serialized array. If you need to manipulate the session data before storing it or before returning it to PHP, you must first use unserialize, change the array, then serialize the array again before passing it along.
Why would you need to manipulate the variables in the session? Perhaps you wish to disallow certain variables from sessions. More likely you'd like to keep certain variables as columns in the session table so you can run queries with them. For example, each user in a store may have an active order. If you add a column to the session table for the order ID, you can run queries that show which users have invoices underway or even which items they have in their baskets.
The primary key of this table is PHP's session identifier, a 32-character string. Each time the user moves to a new page, the application updates the LastAction column. That way we can clear out any sessions that appear to be unused. The Invoice column holds a pointer to a row in an invoice table and the SessionData holds the serialized variables in the user's session.
These are notes I made after reading this book. See more book notes
Just to let you know, this page was last updated Saturday, Mar 06 21