Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9039099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:39:12+00:00 2026-06-16T09:39:12+00:00

Possible Duplicate: How to put string in array, split by new line? Is it

  • 0

Possible Duplicate:
How to put string in array, split by new line?

Is it possible when using the $_REQUEST[''] to only request one row from a text area?

Something like:

<?php 

  $text = $_REQUEST['originalText']; 

?>

<textarea name="firstRow" rows="5" cols="50" wrap="OFF" ><?php 
    echo $text
?></textarea>

<form action="index.php" method="POST" name="editText">
  <input name="submit" value="Edit Text" type="submit"><br>
  <textarea name="originalText" rows="5" cols="50" wrap="OFF"></textarea>
</form>

Instead of echo $text is it possible to echo just the first row of $text?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:39:13+00:00Added an answer on June 16, 2026 at 9:39 am

    I don’t understand exactly what you mean by first row, but if you want to get the first line (before an “enter”) do the following:

    list($first_line) = explode("\n", $text, 2);
    

    Or alternatively (and preferably):

    $first_line = strstr($text, "\n", true);
    

    See strtrDocs and Demo – you might want to add a "\n" to the $text to ensure at least one line exists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Java Remove Duplicates from an Array? String={3333,4444,5555,5555,1111} Using Delimiter i have put
Possible Duplicate: How many Python classes should I put in one file? Coming from
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) This should be
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: Bash: How to Put Line Comment for a Multi-line Command I would
Possible Duplicate: Random number generator only generating one random number My code below is
Possible Duplicate: How to split a string literal across multiple lines in C /
Possible Duplicate: Get random item from array I need a code to set a
Possible Duplicate: Best way to strip punctuation from a string in Python I have
Possible Duplicate: how to inset a new array to my jagged array i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.