Code solutions to PHP, JS, CSS

Spread your code soluces to the world

Love me

Search results for : tags    (9)

Extract images from a page (php)

Getting all IMG sources and ALT from a local or remote page that returns an array. This function uses the DOM API from PHP 5. get_i( file ) = array( att, value )
solucior.com/26-Extract_images_from_a_page.html

Sound effects on an action with HTML5 (javascript)

HTML5 has simplified the handling of multimedia files. The simple tag audio replaces the couple object embed with param. A single line of code is sufficient and it is controllable with javascript. In the example below the onmouseout is used to refresh the source of the audio file. In addition to the preload attribute, you can use in the same...
solucior.com/33-Sound_effects_on_an_action_with_HTML5.html

Load image with page scroll.Lazy loading (javascript)

Images are displayed only when they are in the visible area of the window (lazy loading). The code work with the page scrolling. You dont need to modify your HTML code. You can replace the favicon.gif by a blank gif/png.
solucior.com/40-Load_image_with_page_scroll_Lazy_loading.html

Extract links from a page (php)

Getting all A HREF links from a local or remote page that returns an array. This function uses the DOM API from PHP 5. get_a( file ) = array( att, value )
solucior.com/25-Extract_links_from_a_page.html

Isolate a color (php gd image)

Here is a class to isolate a primary color rendering of a photo black and white. The choice of using Object-oriented programming instead of a function gives the advantage to add filters or other image effects thereafter. Instantiation [code]$obj = new image_effect(); // Optional : ratio size of the working image. default : 2 ...
solucior.com/23-Isolate_a_color.html

wordwrap without breaking words (php)

A simple function to cut a character string without breaking words. string wrap_word ( string $str [, int $length = 350] )
solucior.com/6-wordwrap_without_breaking_words.html

Convert unknown text to ISO8859-1 (php)

This method is useful if you get a text field to display in ISO8859-1. In some cases, you do not know if the writer has written characters in UTF8 or ISO. Especially if the text has gone through several transitional stages.
solucior.com/9-Convert_unknown_text_to_ISO8859-1.html

Dynamic image resizing according to location (javascript)

This javascript method resize image according to its location in the page. Images do not overflow the page or div that contains them. It works automatically, it is not necessary to modify the HTML content of the body. Implementation : • copy the javascript code in the header, between <head> and </head> • In the body...
solucior.com/19-Dynamic_image_resizing_according_to_location.html

Close HTML tags function (php)

A simple function to close all open HTML tags from text. To be used for example when you propose an editable field with HTML.
solucior.com/1-Close_HTML_tags_function.html