• 0

Removing text from input


Question

5 answers to this question

Recommended Posts

  • 0

k that helps a litle but how do i get the .png awau

in form (textfield name is item) i have entered aaron.png

$item = $_POST['item']

$newitem = <some functinn> ($item, .png)

echo("$newitem")

it would echo aaron

Link to comment
Share on other sites

  • 0

What exactly do you want? Do you want the filename without extension? Or do you want everything before the extension, including directories?

If you just want the filename do this:

$pathnfo = pathinfo($_POST['item']);
$newitem = $pathnfo["basename"];
echo("$newitem");

If you want the directory and filename, so this:

$pathnfo = pathinfo($_POST['item']);
$newitem = $info["dirname"] . "/" . $info["basename"];
echo("$newitem");

Link to comment
Share on other sites

  • 0

view.php?color=red&user=56.png

thats what the url will look like, i want it take the user varable

$id = $section = $HTTP_GET_VARS['user'];

i want to get the 56 out of there... so there is no .png

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.