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

  • Home
  • SEARCH
  • 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 77349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:48:59+00:00 2026-05-10T20:48:59+00:00

For example, I hate typing things like: $x = mysql_escape_string(stripslashes($_GET[‘x’])); Is there a way

  • 0

For example, I hate typing things like:

$x = mysql_escape_string(stripslashes($_GET['x'])); 

Is there a way to alias those two functions in init.php or something without writing a separate function that takes one argument and returns that argument with those functions applied to it?

My C/C++ is not very good, but I think this is sort of like #typedef but for functions?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T20:48:59+00:00Added an answer on May 10, 2026 at 8:48 pm

    This should do the trick :

    // Macros $mes = 'mysql_escape_string'; $ss = 'stripslashes';  // Using your macros $x = $mes($ss($_GET['x'])); 

    Though I don’t recommend coding like this at all.

    I’m just answering the question since you said you didn’t want to create any new function and get a ‘#define’-like functionality.

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

Sidebar

Related Questions

I hate posting this since it's somewhat subjective, but it feels like there's a
I hate repeating functions, particularly in Excel formulas. Is there any way that I
Is there any way to insert an NSLocalizedString in interface builder. For example set
Example: an Employee table with an optional DateOfBirth field can be normalized into two
Example: batchTag is an enumerated type attribute of a batchRange, with values like so:
I have coworkers who occasionally use typedef to avoid typing. For example: typedef std::list<Foobar>
I hate to even ask this as there are plenty of examples with regard
I have several flag-like enumerations, in C++. For example: enum some_state { state_normal =
Is there some way to filter what files Visual Studio 2005 (C++) steps into?
In the contrived example below, which is the proper way to name my [Nn]ame

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.