Jump to content

mraza

Members
  • Posts

    329
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mraza's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. First of all thanks the182guy for suggestion, and thank you WebStyles too for contributing. Actually i forget to mention sir, its an image hosting type script, and i wants to host images on sub-dmains so i can split server load to various sub-domains on other servers. so now i am generating a link like this http://mysite.com/SomeRandmID/filename.image so user can use above link to share there images. Now if i use that method which you are both suggesting, how can i manage that. so actual image link user will get as below. http://sub-domain.mysite.com/SomeRandmID/filename.image
  2. Hi I have a form which is used to upload files to my server, now i need to move files to another server as soon they are uploaded, but move_uploaded_file will work with local server where form has been submitted. i was thinking to add some ftp functions to upload that file to remote server but is there any better way? that user dont notice ftp connection timing. i wants to use less ftp connections and user should not notice delay timing for image upload. Thanks for any suggestion.
  3. hi is it possible to run multi instance of a loop? here is my code example $data = array ( array("first" = >"First name"), array("first" = "Second name") ); foreach($data as $process){ echo $process["first"] . "\n"; // some function($process["first"]) } above will output Fist name Second name in above foreach it echo first element of $data array then echo next element, can it process both at same time? like for example if my $data array contains 20 multidimensional array and i wants to process 5 array at same time rather then it will process all one by one. is there any possibility? Thanks for any help.
  4. hi, I have a domain over 2k posts indexed.. I wants to change it from http://site.com/category/1021-this-is-title-here.html to http://site.com/category/this-is-title-here-1021.html so post id would go at the end with my new structure. and still if someone visit that old url it will redirect to new url of that post. What should i do to achieve it , i believe something todo with .htaccess Thanks for any help
  5. Thanks for reply does it support ajax calls? i see no here. http://www.phpframeworks.com/php-frameworks/index.php?id=9 also i see a lot of votes for Yii framework there.
  6. Hi, I am going to start a project which would be like a single page site, sending requests from one page and displaying result on same page. I would like to know which framework would be better. here i see top 10 frameworks http://www.phpframeworks.com/top-10-php-frameworks/ any suggestion please? Thanks
  7. Hi, I have some text coming like this this is text <a href=""> School </a> and this is <a href=""> another text </a> and this what i need to remove <a href="">http://somelink...</a> also I wants to remove all href tags but leave inner text if it is not an http link, i have this regex but this remove all of my text but as above example i wants to keep "School" and "another text". results should like like this after regex. this is text School and this is another text and this what i need to remove also . regex i have preg_replace("/<a[^>]+href[^>]+>.*\<\/a\>/", "", $text); but this remove all href tags with inner text. thanks for any help
  8. Thanks but when i use above i get question marks ���������� my code $file = "C:\file.txt"; $data = file_get_contents($file); // tried with this too // $data = mb_convert_encoding($data, "UTF-8", "ISO-8859-1"); header("Content-Type: text/html; charset=UTF-8"); echo $data; also when i did detect i get UTF-8 Result $data = file_get_contents($file); echo mb_detect_encoding($data); // echoed UTF-8
  9. thanks for replies. I tried both way but did not worked. here is original file content http://www.pastecode.info/view/29305328 and here is problem if i use above codes http://www.pastecode.info/view/75500574 when i tried with htmlentities($data, ENT_QUOTES, "UTF-8"); i get cahrs like this and i had to use $data = mb_convert_encoding($data, "UTF-8", "ISO-8859-1"); or it just display blank page. ßßßÿÿÿ my code again: $file = "C:\file.txt"; $data = file_get_contents($file); // tried three of them one by one and together etc but same problem. //$data = mb_convert_encoding($data, "UTF-8", "ISO-8859-1"); //$data = htmlentities($data, ENT_QUOTES, "UTF-8"); //header("Content-Type: text/plain; UTF-8"); echo $data; thanks for any help.
  10. Hi, I have few files which i need to display in correct format and also save in db to use. My problem is here is my code: $file = "C:\\file.txt"; $data = file_get_contents($file); $data = '<pre>'; $data .= mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); $data .= '</pre>'; echo $data; but when i echo $data i get weird characters . here is result http://paste2.org/p/1361878 Thanks for any help.
  11. nvm got it sorted with "description" =>(string) $description, Regards
  12. HI, I am having a wierd problem using abvoe method. here is my code $items = array(); foreach ($xmlload->channel->item as $item) { $ns_content = $item->children('http://purl.org/rss/1.0/modules/content/'); $desc = $ns_content->encoded; $description = $item->description; // echo $description; // this looks nomal here on echo $categories = array(); foreach ($item->children() as $child) { if ($child->getName() == 'category') { $categories[] = (string) $child; } } $items[] = array( "title" => $item->title, "link" => $item->link, "desc" => $desc, "description" => $description, "categories" => $categories ); } $items = array_reverse($items); print_r($items); when i do print_r i get this result [0] => Array ( [title] => SimpleXMLElement Object ( [0] => Title of post ) [link] => SimpleXMLElement Object ( [0] => http://www.linktofeed.html ) [desc] => SimpleXMLElement Object ( ) [description] => SimpleXMLElement Object ( ) [categories] => Array ( ) ) in [description] i am getting SimpleXMLElement Object as description not original one. I tried to output echo as in above code // echo $description; // this looks nomal here on echo and there it display correct description but not when added in $items description. any help? Thanks
  13. Ok thanks for help. all sorted.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.