Jump to content

[SOLVED] Limit Echo


supanoob

Recommended Posts

do you want to do it so if shows something like this

 

 

 

Description: this is like a chopped ver.....

 

(the above shows there is more text then what has been echoed)

 

or do you just wanna word limit the text so no more that 250 characters cannot be entered.

Regards

Mark

Link to comment
Share on other sites

it can be done using php but why?? if youre going to do it using php that means that you will load another page with the full description.

With JavaScript you can just send the short description using php and make a javascript/ajax function that loads the rest upon request.

Link to comment
Share on other sites

okay. can you tell me exactly what are you trying to do ?? like you have page1 and there is a list of short descriptions and when you click on one it send you to another page with the full description and other information about the user?

or it is more like a youtube kind of a thing like you one description per page but you dont want to the description to take the whole page so you want to display the first 250 and when the user clicks for example (View full desc.) it shows the full description?

Link to comment
Share on other sites

Basically you have 1 profile page on this you have an image 2 descriptions

 

1) Character Description (for a description you have made about your character)

2) Player Description (a description about YOU)

 

now i want these to be upto 1500 characters but i only want 250 of them to show on the profile page, once you click them it will take you to another page/step where you can view the rest of the profile

Link to comment
Share on other sites

ohh then use php. you konw how to load data from the database,right?

then use

$short_desc = substr($description, 0, 250);
echo $short_desc." <a href='profile.php?user_id=".$user_id."'> View profile</a>";

hope that helps

 

Link to comment
Share on other sites

Basically i want to limit the ammount of data echoed. So say someone types a 1500 word description about themself, i want to just echo 250 characters of that. is there a way to do this?

 

if($input>250)

{

//use 250 only

}

 

hope that helps

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.