Jump to content

salman_ahad@yahoo.com

Members
  • Posts

    167
  • Joined

  • Last visited

    Never

Everything posted by salman_ahad@yahoo.com

  1. I am working with this API Returns JSON. curl http://letsbetrends.com/api/current_trends How to grab just the trending topics Which come after "name" : "xxxxxxxx" (the x's) Or how to work with curls ??
  2. @madTechie It did not work for some reason. Could you please explain me your regular expression in detail please
  3. I am able to grab text with this code <?php $urlpage = 'http://xyz.com/'; $filetext = fopen("$urlpage", "r"); while (!feof($filetext)) { $theline = fgetss($filetext, 2048); echo "$theline<br>"; } fclose($filetext); ?> How do I grab some specific words, I don't need everything.
  4. I need to know the first news heading on news.yahoo.com I need PHP code or script in my webpage which grabs words from Yahoo. Any CODE SNIPPET PLEASE
  5. Your solution is not working..it was giving an error. I think there is an in the regular expression, it is not giving the desired result.
  6. @MadTechie Lets go over with the code... $para = $_POST['para']; //Getting para in variable } $sent = split('[.!?]',$para); //Split based on .!? foreach ($sent as $content) //for all the arrays, sentences(sent)...do this { if (strlen($content)<=115) //some condition... echo $content.'.<br />'; Now this code is resulting is few sentences starting with \"We need to eliminate this by checking sentences not starting with QUOTE PLEASE HELP WITH CODE
  7. I want to be able to check if my string contains ". $sent = split('[.!?]',$para);//split on .!? "Lets say this is my sentence." //ended with " after . Then I am getting next sentence as " This is second sentence. I dont want the sentence to start with "
  8. What is this code '/".*?[.!?]"(.*?$)/sm' Also what does preg_match_all does
  9. I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect and start from next sentence I am splitting into two sentences "This is first sentence." This is second. When I split it is taking the second sentence as " This is second sentence. Which I dont want Help please
  10. Now I changed the code a little if ($_POST['Submit']) { $para = $_POST['para']; } $sent = split('.',$para); echo substr($sent[0],0,120). '<br />'; // sent array strings, start@0, end@120 echo substr($sent[1],0,120). '<br />'; echo substr($sent[2],0,120). '<br />'; Now how should add ...Read More after every string
  11. This is my code if ($_POST['Submit']) // Take user input from FORM when SUBMIT { $para = $_POST['para']; // insert in argument 'para' } $sent = explode(".",$para); // explode when delimiter '.' is encountered echo $sent[0] . '<br />';echo $sent[1] . '<br />'; //echo different sentences and go to next line Now I want the sentences longer than 120 characters to show ...Read More after the 120 characters. Please show me the code. Thanks in advance
  12. for example if ($_POST['Submit']) //taking user input when Submit { $para = $_POST['para']; assigning it to para } $sent = explode(".",$para); exploding para when the "." is read echo $sent[0]; echo $sent[1]; How do I enter to next line in between echo's? echo $sent[2]; echo $sent[3];
  13. Here is what I am trying to do example: Para1[123.456.789!] 3 sentences Para2[abc?defghij.klmnop! etc] 3+ sentences It should split the paras into sentences based on delimiters (.?!), count the length of characters in those sentences. If any sentence more than "120" charaters it should attach "..." at the end of sentence. Then email the sentences in an excel(attached) example.xls 123. 456. 789! abc? defghij. klmnop! dskasdjkasjkdjfkdgjkfgjflhkglfhkdljsakfjdkf... Please send me sample code, please don't just tell me I can use explode() function or split....etc
×
×
  • 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.