Jump to content

Recommended Posts

<?php
function mid_string($string,$len){
$count = strlen($string);
$half = $count*.5;
$half--;
return substr($string,$half,$len);
}
?>

That will return a string of length you define in calling it from the string inputted started at the exact half way through

nope, read up on php.net cause you won't get very far with php if you can't read what it says there.  a string type variable consist of a series of characters that can be manipulated by the string function library and used in a lot of applications.

 

all characters in it are relative for a comparasion/function use.

thanks for nothing...obviously you as a php coder you have no idea how hard it is trying to grasp something from the manual without hands on experience...

 

telling someon to go read the manual is about the lamest advice that anyone can give...

 

effing worthless

 

if anyone else can help me I would much oblighed...I am not asking anyone to write a script I am just asking for some hands on syntax examples that the manuals fail top provide...

if it sounds like I am being hard on you it is because I am.  If you don't learn now how to solve your own problems there is no way you will ever learn.  Now if you went into php.net and looked up strlen and ask a question like "What does it return" I'd say an integer.  but asking what it does/how to use it is pointless if you don't try it on your own/look it up on your own.

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.