tag:blogger.com,1999:blog-19271727442048421532024-03-23T03:15:52.664-07:00c4 Code - About TechnologiesCode & help 4 PHP, JavaScript, HTML, DHTML, CSS, Flex, Dot Net, SharePoint, C-Sharp, Java, ReactJs, NextJs, Node, Web Tools, BlockchainDhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-1927172744204842153.post-11106385621553713862009-08-06T01:37:00.000-07:002009-08-06T01:47:52.148-07:00Replace Character Codes using PHP.How to replace character codes for german using str_replace php function. Characters such as :ä Ä'éöÖüÜOther chars.see simple example. <?php $find ="ü"; $rep = "u"; $str = "aüstin"; echo str_replace($find,$rep,utf8_encode($str));?>Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-44096616733963807572009-07-24T00:49:00.000-07:002009-07-24T01:02:56.517-07:00Convert excel to CSV file using PHP, Linx ServerHow to convert xls file into csv file using php or LAMP, Look at simple example to convert excel to csv file using php on linux server. <?php require_once 'Excel/reader.php'; $excel = new Spreadsheet_Excel_Reader(); $excel->setOutputEncoding('CP1251'); $excel->read('b.xls'); $x=1; $sep = ","; ob_start(); while($x<=$excel->sheets[0]['numRows']) { $y=1;Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com1tag:blogger.com,1999:blog-1927172744204842153.post-71575693029999955602009-06-12T00:43:00.000-07:002009-06-12T00:52:20.232-07:00How To Read RSS Using PHPHere is the simple code to read RSS Feeds using php with simpladxml_load_string function.CODE:1 : <?php2 : $displayItems = 5;3 : $itemCounter = 0;4 : $rss = simplexml_load_file("http://put here url of RSS Feed");5 : Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-67972424307748991932009-06-02T23:58:00.000-07:002009-06-03T00:14:01.157-07:00Search Records into XML Using PHPThere is an example for search items or block into xml using php with simplexml_load_string method or function, this will return you record block for particular query.query = usCODE:1 : <?php2 : # parm query=delhi , us3 : $xmlStr = '<?xml version="1.0" encoding="utf-8"?>4 :  Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-46824265052770917302009-05-18T04:59:00.000-07:002009-05-18T06:09:23.422-07:00Set Script Timeout In PHPIn PHP.ini define a script timeout (max_execution_time) if it's exceed , the script returns a fatal error. The default limit is 30 seconds. to set script max execution time we can use below function.set_time_limit(1000) //1000 secondsORini_set("max_execution_time","1000"); //1000 secondsDhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-5194096357852514432009-05-11T05:25:00.000-07:002009-05-11T05:44:19.516-07:00Create XML File From Mysql TableHow to create XMLFile Form Mysql Table function createXMLFile($result, $feildLength, $dir) { $headers = array(); $xmlData = array(); $str = ""; $counter = 0; for ($i=0;$i<$feildLength;$i++) { array_push($headers, mysql_field_name($result, $i)); } $xmlFileData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; while ($row = mysql_fetch_array($result)) { for ($i=0;$i<$Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-52153413155112490462009-05-10T23:47:00.000-07:002009-05-10T23:49:36.163-07:00How To Check Length Using ereg functionCheck length of string using ereg php function$str = "1234";if(ereg([0-9]{4}, $str)) {pirint "Matched";}Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-82683485037632206262009-04-03T01:41:00.000-07:002009-05-01T11:05:00.104-07:00Create Word Document Using PHPHere is the example of creating word document using php.<?php$wordObj = new COM("word.application") or die ("Could not create an instance of word");echo "Version : {$wordObj->version}";$wordObj->visible = 1;$wordObj->Documents->Add();$wordObj->Selection->TypeText("Hello World.."); // add text here$wordObj->Documents[1]->SaveAs("sample.doc"); // save location$wordObj->Quit();$wordObj->Release(Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com1tag:blogger.com,1999:blog-1927172744204842153.post-45581252635532547112009-04-01T06:09:00.000-07:002009-05-01T11:07:14.956-07:00How to set PHP Cookie for Domainsetcookie("CookieName","cookieValue"," expire","directory path ","Domain name");Example :setcookie("TestCookie","hi", time()+3600,"/dir1/dir2/","mytest.com");code4developerhttp://www.blogger.com/profile/09094740117332781644noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-17227342311421622832009-03-31T01:17:00.000-07:002009-05-01T11:09:38.853-07:00Remove Query String Using Regular ExpressionsYou can use this code to remove query string from URL.<?php$url = "http://www.testDomain.com/testPage.php?q1=queryString1&q2=queryString2";$search = '|(\.php)(.*)|i';$replace = '${1}';echo preg_replace( $search, $replace, $url );?>code4developerhttp://www.blogger.com/profile/09094740117332781644noreply@blogger.com0tag:blogger.com,1999:blog-1927172744204842153.post-37743166433163193692008-10-27T02:22:00.000-07:002009-05-15T10:37:08.033-07:00Download Data File From SharePointHow to download Files From SharePoint Using php?This example is useful to download sharepoint data file using php. I have try to download sharepoint file using PHP CURL and i have done it so try it.<?php$sp_login_id = "test"; // sharepoint user id$sp_password = "********"; //sharepoint password$sp_data_file_url = "http://server/test.doc"; // data file url$ch = curl_init(); // initialize curl Dhyanihttp://www.blogger.com/profile/13672278628051950277noreply@blogger.com0