Jump to content

Jeyalakshmi

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by Jeyalakshmi

  1. You're telling it to do the same thing 3 times, which is always to replace " is" with " was".  The first replace is straightforward.  The second replace uses parentheses to specify that the space is a subgroup (which isn't necessary for this example), and the replacement is the word "was" preceded by the same pattern that "is" matched on.  Since it can only match on a space, the replacement will be " was".  The third replacement is doing the same thing, but it also creates a second subgroup out of the entire thing, and once again the replacement matces with " was".What do you expect to happen?

    i cant understand that sub group and all could you please explain me more clearly
  2. <?php$string = "This is a test";echo str_replace(" is", " was", $string);echo ereg_replace("( )is", "\\1was", $string);echo ereg_replace("(( )is)", "\\2was", $string);?> output is :This was a testThis was a testThis was a testcan any one know how this has come

  3. I'm writing this mail form and I don't know how to get user input from the fields Name and Email. I have tried using $_GET, $_REQUEST, and $_POST, but everytime I run it, I get this error:Notice: Undefined index: Email in c:\appserv\www\default.php on line 74Can anyone please help? Here's my code:Name: <input type="text" name="Name" /><br><br>      Email: <input type="text" name="Email" /><br><br>      Message:<br><br>      <textarea rows="8" cols="50" name="Message" ></textarea>      <br><br>      Thank you for visiting the site.      <br><br>      <input type="submit" value="Send"/>      <br><? php$name = $_GET["Name"];$from = $_GET["Email"];?>Thanks in advance.

    do you want to validate that e mail form or simply you are creating email form. in html you didnt specify any form tag.check this link www.php.net this is the complete resource for phpwhat you going to do explain clearlythanks
  4. Make sure you have the right path.  Print out the variable __FILE__ to see the current path and filename.  Sometimes hosts don't let you see the actual path when they set up a virtual directory, but you can't use the virtual directory path to open a file.

    friends i got the output. problem while saving the file
  5. Sorry i don't understand what you mean :) If you want to learn something search for some tutorials or buy a book.Practise as you go along.If you get stuck ask your questions here. :)

    ok do you know any good book
  6. <?php$f=fopen('/home/ramkumar/Desktop/a.txt','r') or exit("unable to open the file");while (!feof($f)) { $x=fgetc($f); echo $x;}fclose($f);?>this is the program i am getting unable to open the file as an output . i tried using both absolute and relative path

×
×
  • Create New...