Skip to main content

Posts

Getting content from xml url using php

step1:first declare a url: $url ="[url]"; step2: getting content for  url:   $results = file_get_contents($url);   ( Note: file_get_contents: which reads entire file into string) step3: Load a xml content into a variable: $xml = simplexml_load_string($results); (NOTE: simplexml_load_string: Interprets a string of XML into an object) then u get content by echo $xml->[tag_name];

Break a string without losing html tags in PHP

< ? php /** * Using this function, we can break ( substr ) a string without losing html tags, * * @param $text *    String which is to be shortened. * * @param $length *    The length of the string . * * @param $ending *    The string that is to be appended after shortening.  Defaults to &hellip; * * @param boolean $exact *   If false, $text will not be cut mid-word * * @param boolean $considerHtml *   If true, HTML tags would be handled correctly * * * @return *     string Trimmed string.. */ Function _html_substr ($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {     if ($considerHtml) {       // If the plain text is shorter than the maximum length, return the whole text       if (strlen ( preg_replace ( '/<.*?>/', '', $text)) <= $length) {         return $text;       } ...

Hope that makes a BIG change in YOU

The Professor began his class by holding up a glass with some water in it. He held it up for all to see & asked the students “How much do you think this glass weighs?” ’50gms!’….. ’100gms!’ …..’125 gms’ … the students answered. “I really don’t know unless I weigh it,” said the professor, “ but , my question is: What would happen if I held it up like this for a few minutes ? ‘Nothing’ …. . the students said.   Ok what would happen if I held it up like this for an hour?’ the professor asked. ‘Your arm would begin to ache’ said one of the student “You’re right, now what would happen if I held it for a day?” “Your arm could go numb; you might have severe muscle stress & paralysis & have to go to hospital for sure!” ….. Ventured another student & all the students laughed  “Very good .  But during all this, did the weight of the glass change?” Asked the professor . ‘ No’ Was the answer. “Then what caused the arm ache & the muscle stress...

Migrate to Drupal 7

Follow this page for more details  http://bhanu555prakash.blogspot.com/p/migrate-to-drupal-7.html it will continuously updates.... These link will be helpful http://btmash.com/article/2011-02-25/migrating-content-using-migrate-module http://drupal.org/migrate Thanks, Bhanu

Smart pagination or page break in Drupal(wysiwyg)

1)Install Smart Paging module   Go to Administration › Configuration › Administer Smart Paging settings.   Under 'Default page break method', select "Manual placement of page break placeholder". 2)Install "wysiwyg" module and 'ckeditor' profile   Go to Administration › Configuration > Wysiwyg profiles > Filtered HTML   Edit the settings of Filtered HTML Profile. Under 'Buttons and plugins' section, check the required options like "Smart Paging ","Image","Bold". 3)Edit the configuration settings of input formats(Filtered HTML, Full HTML, Plain Text)   Go to Administration › Configuration > Text formats. Edit the required input format. For example say "Filtered HTML". Under  "Enabled filters" section, check the 'Smart Paging' option and uncheck all the remaining checkboxes. 4)Go to Content type 'article' and create new content. We will see the wy...

Here is the Solution for Every Problem

Here is the Solution for Every Problem Nice approach towards the problems “Life is a problem” Vs. “In Life there are problems” If we get any problem we usually say “Life is a Problem” better than this we can say that “In Life will have some problems” this sounds good and we will try to solve those, because we said problem will be a part of life. If you feel that, you have many problems then here is the solution…… to make them less… >  Know about your Problems. Take a chart and Marker. Write your problems on chart using marker (Might be small, silly or important) which includes all types (Social, Professional, Personal, Ethical). Write whatever comes to your mind. ( Note : It should complete in 5 min). Read them only once (Complete it in one min). If you get some more problems than write them but in separate section called Late Entries (Don’t read them again). At this stage you have to feel free because you have your problems on paper. Don’t add p...